Skip to content

Commit

Permalink
Move to 6.1.0 and new unittest Get_ShouldReturn_WhileMapIsEmpty
Browse files Browse the repository at this point in the history
  • Loading branch information
Wsm2110 committed Oct 31, 2024
1 parent c2046ff commit 822aed4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/Faster.Map.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
<CopyRight>MIT</CopyRight>
<PackageReleaseNotes>
Introducing CMAP which is a incredibly fast concurrent hashmap
New Features:

Enhanced emplace Behavior: The emplace function now operates with improved efficiency:
Duplicate Management: When a duplicate entry is detected, emplace updates the existing entry instead of creating a new one.
New Entry Insertion: If no duplicate is found, a new entry is added.

Optimizations:

Smart Tombstone Management: Introduced an optimized approach to manage and avoid tombstones, enhancing data integrity and reducing unnecessary overhead.
</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/Wsm2110/Faster.Map</PackageProjectUrl>
<AssemblyVersion>6.0.4</AssemblyVersion>
<FileVersion>6.0.4</FileVersion>
<AssemblyVersion>6.1.0</AssemblyVersion>
<FileVersion>6.1.0</FileVersion>
<Title>Fastest .net hashmap</Title>
<Version>6.0.4</Version>
<Version>6.1.0</Version>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Description>
Incredibly fast (concurrent) hashmap
Expand Down
15 changes: 15 additions & 0 deletions unittests/Faster.Map.DenseMap.Tests/GetTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,5 +275,20 @@ public void Get_ShouldReturnTrueForReinsertedKey_WhenUsingHighLoadFactorAndResiz
Assert.True(map.Get(8, out var value));
Assert.Equal("newEight", value);
}

[Fact]
public void Get_ShouldReturn_WhileMapIsEmpty()
{
var dense = new DenseMap<int, int>();
for (int i = 1; i <= 16; ++i)
{
dense.Emplace(i, 0);
dense.Remove(i);
}

var result = dense.Get(0, out int value);

Assert.False(result);
}
}
}

0 comments on commit 822aed4

Please sign in to comment.