Skip to content

Commit

Permalink
When hashing the entire string, case sensitivity of hash and equals s…
Browse files Browse the repository at this point in the history
…hould be the same
  • Loading branch information
andrewjsaid committed Oct 26, 2023
1 parent a94513c commit 328d9f1
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,10 @@ The System.Collections.Immutable library is built-in as part of the shared frame
<Compile Include="System\Collections\Frozen\String\OrdinalStringFrozenSet_RightJustifiedCaseInsensitiveSubstring.cs" />
<Compile Include="System\Collections\Frozen\String\OrdinalStringFrozenSet_RightJustifiedSubstring.cs" />
<Compile Include="System\Collections\Frozen\String\OrdinalStringFrozenSet_RightJustifiedSingleChar.cs" />

<Compile Include="System\Collections\Frozen\String\OrdinalStringFrozenDictionary_FullCaseSensitiveHashCaseInsensitiveEquals.cs" />
<Compile Include="System\Collections\Frozen\String\OrdinalStringFrozenDictionary_LeftJustifiedSingleCharCaseInsensitive.cs" />
<Compile Include="System\Collections\Frozen\String\OrdinalStringFrozenDictionary_LeftJustifiedSubstringCaseInsensitive.cs" />
<Compile Include="System\Collections\Frozen\String\OrdinalStringFrozenDictionary_RightJustifiedSingleCharCaseInsensitive.cs" />
<Compile Include="System\Collections\Frozen\String\OrdinalStringFrozenDictionary_RightJustifiedSubstringCaseInsensitive.cs" />
<Compile Include="System\Collections\Frozen\String\OrdinalStringFrozenSet_FullCaseSensitiveHashCaseInsensitiveEquals.cs" />
<Compile Include="System\Collections\Frozen\String\OrdinalStringFrozenSet_LeftJustifiedSingleCharCaseInsensitive.cs" />
<Compile Include="System\Collections\Frozen\String\OrdinalStringFrozenSet_LeftJustifiedSubstringCaseInsensitive.cs" />
<Compile Include="System\Collections\Frozen\String\OrdinalStringFrozenSet_RightJustifiedSingleCharCaseInsensitive.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,8 @@ private static FrozenDictionary<TKey, TValue> CreateFromDictionary<TKey, TValue>
}
else
{
frozenDictionary = analysis.IgnoreCaseForEquals
? new OrdinalStringFrozenDictionary_FullCaseSensitiveHashCaseInsensitiveEquals<TValue>(keys, values, stringComparer, analysis.MinimumLength, analysis.MaximumLengthDiff)
: new OrdinalStringFrozenDictionary_Full<TValue>(keys, values, stringComparer, analysis.MinimumLength, analysis.MaximumLengthDiff);
// if (IgnoreCaseForEquals) => Can only be true if there are no letters, thus case sensitive comparison still works here.
frozenDictionary = new OrdinalStringFrozenDictionary_Full<TValue>(keys, values, stringComparer, analysis.MinimumLength, analysis.MaximumLengthDiff);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,8 @@ private static FrozenSet<T> CreateFromSet<T>(HashSet<T> source)
}
else
{
frozenSet = analysis.IgnoreCaseForEquals
? new OrdinalStringFrozenSet_FullCaseSensitiveHashCaseInsensitiveEquals(entries, stringComparer, analysis.MinimumLength, analysis.MaximumLengthDiff)
: new OrdinalStringFrozenSet_Full(entries, stringComparer, analysis.MinimumLength, analysis.MaximumLengthDiff);
// if (IgnoreCaseForEquals) => Can only be true if there are no letters, thus case sensitive comparison still works here.
frozenSet = new OrdinalStringFrozenSet_Full(entries, stringComparer, analysis.MinimumLength, analysis.MaximumLengthDiff);
}
}

Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 328d9f1

Please sign in to comment.