Use overflow subtraction operator

This commit is contained in:
Justin Mazzocchi 2020-09-06 16:11:56 -07:00
parent a689463907
commit 9e8b91e23b
No known key found for this signature in database
GPG key ID: E223E6937AAFB01C

View file

@ -40,7 +40,7 @@ private extension DeterministicHasher {
case .djb2a: case .djb2a:
return ((result << 5) &+ result ^ next) % Self.u32mod return ((result << 5) &+ result ^ next) % Self.u32mod
case .sdbm: case .sdbm:
return next &+ (result << 6) &+ (result << 16) - result return next &+ (result << 6) &+ (result << 16) &- result
case .fnv1: case .fnv1:
return (result * Self.fnvPrime % Self.u32mod) ^ next return (result * Self.fnvPrime % Self.u32mod) ^ next
case .fnv1a: case .fnv1a: