From cdef8238bd5925caf855023db4b00dc449307aa2 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 11 Sep 2021 15:11:09 -0500 Subject: clean up warnings --- src/slskd/Common/Extensions.cs | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'src/slskd/Common/Extensions.cs') diff --git a/src/slskd/Common/Extensions.cs b/src/slskd/Common/Extensions.cs index 077f5b17..4f2cf29f 100644 --- a/src/slskd/Common/Extensions.cs +++ b/src/slskd/Common/Extensions.cs @@ -88,36 +88,6 @@ namespace slskd return str.Substring(0, pos) + replacement + str.Substring(pos + phrase.Length); } - /// - /// Computes a stable/consistent hash code for strings. - /// - /// - /// https://stackoverflow.com/questions/5154970/how-do-i-create-a-hashcode-in-net-c-for-a-string-that-is-safe-to-store-in-a - /// - /// The string for which the hash code is to be computed. - /// The hash code. - public static int GetStableHashCode(this string str) - { - unchecked - { - int hash1 = 5381; - int hash2 = hash1; - - for (int i = 0; i < str.Length && str[i] != '\0'; i += 2) - { - hash1 = ((hash1 << 5) + hash1) ^ str[i]; - if (i == str.Length - 1 || str[i + 1] == '\0') - { - break; - } - - hash2 = ((hash2 << 5) + hash2) ^ str[i + 1]; - } - - return hash1 + (hash2 * 1566083941); - } - } - /// /// Determines whether the string is a valid regular expression. /// -- cgit v1.2.3