Skip to content

Commit

Permalink
Avoid Unsafe.As in RangeCharSearchValues (#112606)
Browse files Browse the repository at this point in the history
  • Loading branch information
xtqqczze authored Feb 16, 2025
1 parent 8a79637 commit c332820
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ internal override int IndexOfAny(ReadOnlySpan<char> span) =>
? PackedSpanHelpers.IndexOfAnyInRange(ref MemoryMarshal.GetReference(span), _lowInclusive, _rangeInclusive, span.Length)
: SpanHelpers.NonPackedIndexOfAnyInRangeUnsignedNumber<ushort, SpanHelpers.DontNegate<ushort>>(
ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(span)),
Unsafe.As<char, ushort>(ref _lowInclusive),
Unsafe.As<char, ushort>(ref _highInclusive),
_lowInclusive,
_highInclusive,
span.Length);

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand All @@ -53,8 +53,8 @@ internal override int IndexOfAnyExcept(ReadOnlySpan<char> span) =>
? PackedSpanHelpers.IndexOfAnyExceptInRange(ref MemoryMarshal.GetReference(span), _lowInclusive, _rangeInclusive, span.Length)
: SpanHelpers.NonPackedIndexOfAnyInRangeUnsignedNumber<ushort, SpanHelpers.Negate<ushort>>(
ref Unsafe.As<char, ushort>(ref MemoryMarshal.GetReference(span)),
Unsafe.As<char, ushort>(ref _lowInclusive),
Unsafe.As<char, ushort>(ref _highInclusive),
_lowInclusive,
_highInclusive,
span.Length);

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand Down

0 comments on commit c332820

Please sign in to comment.