util.js: remove unnecessary conditional

This commit is contained in:
siikamiika 2017-10-24 23:12:55 +03:00
parent 73d542547b
commit 6f43fffb4e

View File

@ -55,10 +55,6 @@ function utilSetDifference(setA, setB) {
function utilStringHashCode(string) { function utilStringHashCode(string) {
let hashCode = 0; let hashCode = 0;
if (string.length === 0) {
return hashCode;
}
for (let i = 0, charCode = string.charCodeAt(i); i < string.length; charCode = string.charCodeAt(++i)) { for (let i = 0, charCode = string.charCodeAt(i); i < string.length; charCode = string.charCodeAt(++i)) {
hashCode = ((hashCode << 5) - hashCode) + charCode; hashCode = ((hashCode << 5) - hashCode) + charCode;
hashCode |= 0; hashCode |= 0;