<_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)/Documentation</_TargetFrameworkDirectories>
<_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)/Documentation</_FullFrameworkReferenceAssemblyPaths>
<SkipCommonResourcesIncludes>true</SkipCommonResourcesIncludes>
- <LangVersion>7.2</LangVersion>
+ <LangVersion>latest</LangVersion>
</PropertyGroup>
<!-- Add Serviceable attribute to the project's metadata -->
<ItemGroup>
}
- // Can be improved with "Ref Local Reassignment"
- // https://github.com/dotnet/csharplang/blob/master/proposals/ref-local-reassignment.md
- bool resized = false;
bool updateFreeList = false;
int index;
if (_freeCount > 0)
if (count == entries.Length)
{
Resize();
- resized = true;
+ bucket = ref _buckets[hashCode % _buckets.Length];
}
index = count;
_count = count + 1;
entries = _entries;
}
- ref int targetBucket = ref resized ? ref _buckets[hashCode % _buckets.Length] : ref bucket;
ref Entry entry = ref entries[index];
if (updateFreeList)
}
entry.hashCode = hashCode;
// Value in _buckets is 1-based
- entry.next = targetBucket - 1;
+ entry.next = bucket - 1;
entry.key = key;
entry.value = value;
// Value in _buckets is 1-based
- targetBucket = index + 1;
+ bucket = index + 1;
// Value types never rehash
if (default(TKey) == null && collisionCount > HashHelpers.HashCollisionThreshold && comparer is NonRandomizedStringEqualityComparer)