OrdinalStringFrozenDictionary_FullCaseInsensitive<TValue>
sealed class OrdinalStringFrozenDictionary_FullCaseInsensitive<TValue> : OrdinalStringFrozenDictionary<TValue>
using System.Collections.Generic;
using System.Runtime.CompilerServices;
namespace System.Collections.Frozen
{
[System.Runtime.CompilerServices.NullableContext(1)]
[System.Runtime.CompilerServices.Nullable(new byte[] {
0,
1
})]
internal sealed class OrdinalStringFrozenDictionary_FullCaseInsensitive<[System.Runtime.CompilerServices.Nullable(2)] TValue> : OrdinalStringFrozenDictionary<TValue>
{
private readonly ulong _lengthFilter;
internal OrdinalStringFrozenDictionary_FullCaseInsensitive(string[] keys, TValue[] values, IEqualityComparer<string> comparer, int minimumLength, int maximumLengthDiff, ulong lengthFilter)
: base(keys, values, comparer, minimumLength, maximumLengthDiff, -1, -1)
{
_lengthFilter = lengthFilter;
}
[return: System.Runtime.CompilerServices.IsReadOnly]
private protected override ref TValue GetValueRefOrNullRefCore(string key)
{
return ref base.GetValueRefOrNullRefCore(key);
}
[return: System.Runtime.CompilerServices.IsReadOnly]
private protected override ref TValue GetValueRefOrNullRefCore<TAlternateKey>(TAlternateKey key)
{
return ref base.GetValueRefOrNullRefCore(key);
}
[System.Runtime.CompilerServices.NullableContext(2)]
private protected override bool Equals(string x, string y)
{
return StringComparer.OrdinalIgnoreCase.Equals(x, y);
}
[System.Runtime.CompilerServices.NullableContext(0)]
private protected override bool Equals(ReadOnlySpan<char> x, [System.Runtime.CompilerServices.Nullable(2)] string y)
{
return MemoryExtensions.Equals(x, y.AsSpan(), StringComparison.OrdinalIgnoreCase);
}
private protected override int GetHashCode(string s)
{
return Hashing.GetHashCodeOrdinalIgnoreCase(s.AsSpan());
}
[System.Runtime.CompilerServices.NullableContext(0)]
private protected override int GetHashCode(ReadOnlySpan<char> s)
{
return Hashing.GetHashCodeOrdinalIgnoreCase(s);
}
private protected override bool CheckLengthQuick(uint length)
{
return ((long)_lengthFilter & (1 << (int)(length % 64))) != 0;
}
}
}