Skip to content

Commit

Permalink
Use byte comparison for LockType instead of Enum.CompareTo which uses…
Browse files Browse the repository at this point in the history
… object. (#851)
  • Loading branch information
badrishc authored Jul 17, 2023
1 parent ea6221d commit 33c4ffe
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ private static int LockCodeComparer<TLockableKey>(TLockableKey key1, TLockableKe
{
var idx1 = GetBucketIndex(key1.LockCode, size_mask);
var idx2 = GetBucketIndex(key2.LockCode, size_mask);
return (idx1 != idx2) ? idx1.CompareTo(idx2) : key1.LockType.CompareTo(key2.LockType);
return (idx1 != idx2) ? idx1.CompareTo(idx2) : ((byte)key1.LockType).CompareTo((byte)key2.LockType);
}

/// <inheritdoc/>
Expand Down

0 comments on commit 33c4ffe

Please sign in to comment.