1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Merge pull request #1849 from m910q/FixStringHashing

Fix string hashing when a single char is left after hashing ints
This commit is contained in:
Brian Fiete 2023-05-23 14:57:33 -04:00 committed by GitHub
commit 84540431fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -427,7 +427,7 @@ namespace System
curPtr += intSize; curPtr += intSize;
} }
while (charsLeft > 1) while (charsLeft >= 1)
{ {
hash = ((hash ^ (int)*curPtr) << 5) &- hash; hash = ((hash ^ (int)*curPtr) << 5) &- hash;
charsLeft--; charsLeft--;