Skip to content

Commit

Permalink
Fix error in Resize method in Dictionary2<TKey, TValue>
Browse files Browse the repository at this point in the history
  • Loading branch information
Enderlook committed Aug 6, 2022
1 parent 53d6e1c commit 87e2ac6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Changelog

##
## v0.4.4

- Remove unnecessary aggressive inlining in `Raise<TEvent>()` method.
- Remove static constructor from `EventManager`.
- Fix errors in `Subscribe` and `Unsubscribe` methods using wrong parameters.
- Fix error when subscribing methods in 64-bits architecture.

## v0.4.3

Expand Down
2 changes: 1 addition & 1 deletion Enderlook.EventManager/Enderlook.EventManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Product>Enderlook.EventManager</Product>
<RepositoryUrl>https://github.com/Enderlook/Net-Event-Manager</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>0.4.3</Version>
<Version>0.4.4</Version>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<LangVersion>10</LangVersion>
Expand Down
2 changes: 1 addition & 1 deletion Enderlook.EventManager/src/Dictionary2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ private void Resize()
ref Entry entry = ref Unsafe.Add(ref entries_Root, i);
if (entry.Next >= -1)
{
int j = (int)HashHelpers.FastMod(entry.HashCode, (uint)size, fastModMultiplier_);
int j = (int)HashHelpers.FastMod(entry.HashCode, (uint)newSize, fastModMultiplier_);
Debug.Assert(j < buckets_.Length, "Index out of range.");
ref int bucket = ref Unsafe.Add(ref buckets_Root, j);
entry.Next = bucket - 1; // Value in buckets is 1-based.
Expand Down

0 comments on commit 87e2ac6

Please sign in to comment.