Skip to content

Avoid Unsafe.As in RangeCharSearchValues - #112606

Merged
MihaZupan merged 3 commits into
dotnet:mainfrom
xtqqczze:BitCast-RangeCharSearchValues
Feb 16, 2025
Merged

Avoid Unsafe.As in RangeCharSearchValues#112606
MihaZupan merged 3 commits into
dotnet:mainfrom
xtqqczze:BitCast-RangeCharSearchValues

Conversation

@xtqqczze

@xtqqczzextqqczze commented Feb 15, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@ghostghost added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Feb 15, 2025
@dotnet-policy-servicedotnet-policy-serviceBot added the community-contribution Indicates that the PR has been added by a community member label Feb 15, 2025
@jkotasjkotas added area-System.Runtime and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Feb 15, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-runtime
See info in area-owners.md if you want to be subscribed.

@xtqqczze

Copy link
Copy Markdown
ContributorAuthor

@MihuBot

@xtqqczzextqqczze changed the title Use Unsafe.BitCast in RangeCharSearchValuesAvoid Unsafe.As in RangeCharSearchValuesFeb 16, 2025
Unsafe.As<char, ushort>(ref _lowInclusive),
Unsafe.As<char, ushort>(ref _highInclusive),
(ushort)_lowInclusive,
(ushort)_highInclusive,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the explicit cast necessary? char implicitly converts to ushort.

@EgorBoEgorBo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@MihaZupan
MihaZupan merged commit c332820 into dotnet:mainFeb 16, 2025
@xtqqczze
xtqqczze deleted the BitCast-RangeCharSearchValues branch February 16, 2025 17:29
grendello added a commit to grendello/runtime that referenced this pull request Feb 18, 2025
* main: (71 commits)
Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20250212.3 (dotnet#112626)
JIT: Unify struct arg morphing (dotnet#112612)
Enable `SA1015`: Closing generic bracket should not be followed by a space (dotnet#112597)
Clean up normalizeLocale for mono browser target (dotnet#112575)
SPMI: Ensure proper zero extension for isObjectImmutable and friends (dotnet#112617)
Quote --version-scripts path (dotnet#112603)
Remove incompatible API from PKCS netstandard2.0 lib
[main] Update dependencies from dotnet/emsdk (dotnet#112393)
Avoid `Unsafe.As` in `RangeCharSearchValues` (dotnet#112606)
Fixed the issue of incorrect return value of PalVirtualAlloc (dotnet#112579)
Fix size used for vectorization check in BitArray (dotnet#111558) (dotnet#111564)
Fix build of windows arm64 crossdac (dotnet#112553)
Simplify `ShuffleTakeIterator.GetCount` (dotnet#112593)
Fix VS div-by-0 in DacEnumerableHashTable code (dotnet#112542)
R2RDump: normalize GC info totalInterruptibleLength (dotnet#112003)
Fix alignment padding and add test for saving managed resources (dotnet#110915)
Adds `ccmp` logic into emitter backend. (dotnet#112153)
Disable AVX10.2 by default (dotnet#112572)
Outbox AesGcm in to Microsoft.Bcl.Cryptography
Make test `IUnknown` conforming (dotnet#112566)
...
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Mar 31, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Runtimecommunity-contributionIndicates that the PR has been added by a community memberreduce-unsafe

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@xtqqczze@EgorBo@stephentoub@jakobbotsch@jkotas@MihaZupan