Closed
Description
As a condition of a while
it doesn't elide the check
while ((uint)i >= (uint)entries.Length)
{
// not elided
if (entries[i].hashCode == hashCode && comparer.Equals(key, entries[i].key))
{
Changing it to an if
+ break
does elide the check
do
{
if ((uint)i >= (uint)entries.Length)
{
break;
}
// elided
if (entries[i].hashCode == hashCode && comparer.Equals(key, entries[i].key))
{
category:cq
theme:bounds-checks
skill-level:expert
cost:small