Skip to content

Commit

Permalink
remove redundant null check in ComputeStringHash
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Dec 21, 2024
1 parent 5e4d216 commit 6786dd0
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@ internal static class FNV_1aHashHelper
/// </summary>
public static uint ComputeStringHash(string s)
{
uint num = default;
if (s != null)
uint num = 2166136261u;
int num2 = 0;
while (num2 < s.Length)
{
num = 2166136261u;
int num2 = 0;
while (num2 < s.Length)
{
num = (s[num2] ^ num) * 16777619;
num2++;
}
num = (s[num2] ^ num) * 16777619;
num2++;
}

return num;
Expand Down

0 comments on commit 6786dd0

Please sign in to comment.