From 9e8b91e23b3c90096602f5eb6c377a6a43aa3f77 Mon Sep 17 00:00:00 2001 From: Justin Mazzocchi <2831158+jzzocc@users.noreply.github.com> Date: Sun, 6 Sep 2020 16:11:56 -0700 Subject: [PATCH] Use overflow subtraction operator --- .../Sources/CodableBloomFilter/DeterministicHasher.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodableBloomFilter/Sources/CodableBloomFilter/DeterministicHasher.swift b/CodableBloomFilter/Sources/CodableBloomFilter/DeterministicHasher.swift index acb7748..18b04fc 100644 --- a/CodableBloomFilter/Sources/CodableBloomFilter/DeterministicHasher.swift +++ b/CodableBloomFilter/Sources/CodableBloomFilter/DeterministicHasher.swift @@ -40,7 +40,7 @@ private extension DeterministicHasher { case .djb2a: return ((result << 5) &+ result ^ next) % Self.u32mod case .sdbm: - return next &+ (result << 6) &+ (result << 16) - result + return next &+ (result << 6) &+ (result << 16) &- result case .fnv1: return (result * Self.fnvPrime % Self.u32mod) ^ next case .fnv1a: