util.js: remove unnecessary conditional
This commit is contained in:
parent
73d542547b
commit
6f43fffb4e
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user