.NET API 253,600 bytes
OrdinalStringFrozenDictionary_Full<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_Full<[
System.
Runtime.
CompilerServices.
Nullable(
2)]
TValue> :
OrdinalStringFrozenDictionary<
TValue>
{
private readonly ulong _lengthFilter;
internal OrdinalStringFrozenDictionary_Full(
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);
}
[
System.
Runtime.
CompilerServices.
NullableContext(
2)]
private protected override bool Equals(
string x,
string y)
{
return string.
Equals(
x,
y);
}
private protected override int GetHashCode(
string s)
{
return Hashing.
GetHashCodeOrdinal(
MemoryExtensions.
AsSpan(
s));
}
private protected override bool CheckLengthQuick(
string key)
{
return ((
long)
_lengthFilter & (
1 <<
key.
Length %
64)) !=
0;
}
}
}