Skip to content

Commit b9b7df9

Browse files
committed
assert
1 parent e043bcd commit b9b7df9

File tree

1 file changed

+2
-1
lines changed
  • src/Build/Collections/RetrievableEntryHashSet

1 file changed

+2
-1
lines changed

src/Build/Collections/RetrievableEntryHashSet/HashSet.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ private T GetCore(string item, int index, int length)
279279

280280
uint collisionCount = 0;
281281
IEqualityComparer<string> comparer = _comparer;
282+
Debug.Assert(comparer != null, "no comparer");
282283
IConstrainedEqualityComparer<string> constrainedComparer = null;
283284
int hashCode = 0;
284285
if (index != 0 || length != item.Length)
@@ -297,7 +298,7 @@ private T GetCore(string item, int index, int length)
297298
{
298299
ref Entry entry = ref entries[i];
299300
if (entry.HashCode == hashCode &&
300-
constrainedComparer == null ? comparer.Equals(entry.Value.Key, item) : constrainedComparer.Equals(entry.Value.Key, item, index, length))
301+
(constrainedComparer == null ? comparer.Equals(entry.Value.Key, item) : constrainedComparer.Equals(entry.Value.Key, item, index, length)))
301302
{
302303
return entry.Value;
303304
}

0 commit comments

Comments
 (0)