refactor: Replace hash code magic number with named constant
Add HashMultiplier constant to BinComparer, BinItem, MultiBin, and Tool Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -96,10 +96,12 @@
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
// Prime multiplier reduces collisions in hash-based collections
|
||||
const int HashMultiplier = 23;
|
||||
int hash = 17;
|
||||
hash = hash * 23 + (Name?.GetHashCode() ?? 0);
|
||||
hash = hash * 23 + Kerf.GetHashCode();
|
||||
hash = hash * 23 + AllowUserToChange.GetHashCode();
|
||||
hash = hash * HashMultiplier + (Name?.GetHashCode() ?? 0);
|
||||
hash = hash * HashMultiplier + Kerf.GetHashCode();
|
||||
hash = hash * HashMultiplier + AllowUserToChange.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user