Skip to content

Commit 39af47f

Browse files
committed
Updated to net7.0
1 parent 360c752 commit 39af47f

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

ASFFreeGames/ASFFreeGames.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
<PropertyGroup>
33
<OutputType>Library</OutputType>
44
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
5-
<TargetFramework>net6.0</TargetFramework>
65
<DebugSymbols>True</DebugSymbols>
76
<DebugType>pdbonly</DebugType>
7+
<TargetFramework>net7.0</TargetFramework>
8+
<TargetFrameworks />
89
</PropertyGroup>
910

1011
<ItemGroup>

ASFFreeGames/BloomFilters/StringBloomFilterSpan.cs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,11 @@ public byte[] ToArray() {
162162
/// <param name="i"> The i. </param>
163163
/// <returns> The <see cref="int" />. </returns>
164164
private int ComputeHash(int primaryHash, int secondaryHash, int i) {
165-
int resultingHash = (primaryHash + (i * secondaryHash)) % HashBits.Count;
165+
unchecked {
166+
int resultingHash = (primaryHash + (i * secondaryHash)) % HashBits.Count;
166167

167-
return Math.Abs(resultingHash);
168+
return Math.Abs(resultingHash);
169+
}
168170
}
169171

170172
/// <summary>
@@ -176,15 +178,17 @@ private int ComputeHash(int primaryHash, int secondaryHash, int i) {
176178
private static int HashString(string s) {
177179
int hash = 0;
178180

179-
foreach (char t in s) {
180-
hash += t;
181-
hash += hash << 10;
182-
hash ^= hash >> 6;
183-
}
181+
unchecked {
182+
foreach (char t in s) {
183+
hash += t;
184+
hash += hash << 10;
185+
hash ^= hash >> 6;
186+
}
184187

185-
hash += hash << 3;
186-
hash ^= hash >> 11;
187-
hash += hash << 15;
188+
hash += hash << 3;
189+
hash ^= hash >> 11;
190+
hash += hash << 15;
191+
}
188192

189193
return hash;
190194
}

0 commit comments

Comments
 (0)