aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFeng Xiao <xfxyjwf@gmail.com>2017-07-13 10:14:49 -0700
committerGitHub <noreply@github.com>2017-07-13 10:14:49 -0700
commit6aa4b20fc7db7e18a37d02db9c4fefe70e07c2d0 (patch)
treea06b62ded00b279501dc3d44bca9ad129479b0a1 /src
parent71f2f0d76ced8a47d72b31df0407ace65f000ac8 (diff)
parentf6ff32cd79f5de0da18b7c44b3908a520d9e93b2 (diff)
downloadprotobuf-6aa4b20fc7db7e18a37d02db9c4fefe70e07c2d0.tar.gz
protobuf-6aa4b20fc7db7e18a37d02db9c4fefe70e07c2d0.tar.bz2
protobuf-6aa4b20fc7db7e18a37d02db9c4fefe70e07c2d0.zip
Merge pull request #3327 from htuch/fix-3322
Use consistent hash across NDEBUG/!NDEBUG builds.
Diffstat (limited to 'src')
-rw-r--r--src/google/protobuf/map.h7
1 files changed, 0 insertions, 7 deletions
diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h
index 28eaf031..6a88600c 100644
--- a/src/google/protobuf/map.h
+++ b/src/google/protobuf/map.h
@@ -862,14 +862,7 @@ class Map {
size_type BucketNumber(const Key& k) const {
// We inherit from hasher, so one-arg operator() provides a hash function.
size_type h = (*const_cast<InnerMap*>(this))(k);
- // To help prevent people from making assumptions about the hash function,
- // we use the seed differently depending on NDEBUG. The default hash
- // function, the seeding, etc., are all likely to change in the future.
-#ifndef NDEBUG
- return (h * (seed_ | 1)) & (num_buckets_ - 1);
-#else
return (h + seed_) & (num_buckets_ - 1);
-#endif
}
bool IsMatch(const Key& k0, const Key& k1) const {