Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove redundant null check in ComputeStringHash #4420

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
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)
SimonCropp marked this conversation as resolved.
Show resolved Hide resolved
{
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
Loading