Skip to content

Commit de17e43

Browse files
committed
the fix for the small TryGetRef
1 parent 0f231e9 commit de17e43

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/FastExpressionCompiler/ImTools.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,8 @@ public static class SmallList
9696
internal const int DefaultInitialCapacity = 4;
9797

9898
[MethodImpl(MethodImplOptions.NoInlining)]
99-
internal static ref T ThrowIndexOutOfBounds<T>(int index, int count)
100-
{
99+
internal static ref T ThrowIndexOutOfBounds<T>(int index, int count) =>
101100
throw new IndexOutOfRangeException($"Index {index} is out of range of count {count} for SmallList<{typeof(T)},..>.");
102-
}
103101

104102
[MethodImpl((MethodImplOptions)256)]
105103
internal static void Expand<T>(ref T[] items)
@@ -998,7 +996,7 @@ public static ref TEntry TryGetEntryRef<K, TEntry, TEq, TCap, TStackHashes, TSta
998996
}
999997
#endif
1000998

1001-
for (var i = 0; i < hashes.Capacity; ++i)
999+
for (var i = 0; i < count; ++i)
10021000
{
10031001
var h = hashes.GetSurePresentItemRef(i);
10041002
if (h == hash)

0 commit comments

Comments
 (0)