aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/map.h
diff options
context:
space:
mode:
authorGravatar Jisi Liu <jisi.liu@gmail.com>2017-07-18 16:26:16 -0700
committerGravatar Jisi Liu <jisi.liu@gmail.com>2017-07-18 16:26:16 -0700
commit3af881c7e2db0553207876acbdb91c6e77974e44 (patch)
tree35e2a96cce802d4235bd29afa396e28ead892fa2 /src/google/protobuf/map.h
parent86975301f1876ce1934612777b8ca6c76520f5cc (diff)
parent942a29cecd36f2a4b22fdd2179635cd548e6bd27 (diff)
Merge master into 3.4.x
Diffstat (limited to 'src/google/protobuf/map.h')
-rw-r--r--src/google/protobuf/map.h15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h
index 2d561c24..6514a0cc 100644
--- a/src/google/protobuf/map.h
+++ b/src/google/protobuf/map.h
@@ -47,9 +47,6 @@
#include <google/protobuf/generated_enum_util.h>
#include <google/protobuf/map_type_handler.h>
#include <google/protobuf/stubs/hash.h>
-#if __cpp_exceptions && LANG_CXX11
-#include <random>
-#endif
namespace google {
namespace protobuf {
@@ -161,7 +158,7 @@ class Map {
private:
void Init() {
- elements_ = Arena::Create<InnerMap>(arena_, 0, hasher(), Allocator(arena_));
+ elements_ = Arena::Create<InnerMap>(arena_, 0u, hasher(), Allocator(arena_));
}
// re-implement std::allocator to use arena allocator for memory allocation.
@@ -915,16 +912,6 @@ class Map {
// Return a randomish value.
size_type Seed() const {
- // random_device can throw, so avoid it unless we are compiling with
- // exceptions enabled.
-#if __cpp_exceptions && LANG_CXX11
- try {
- std::random_device rd;
- std::knuth_b knuth(rd());
- std::uniform_int_distribution<size_type> u;
- return u(knuth);
- } catch (...) { }
-#endif
size_type s = static_cast<size_type>(reinterpret_cast<uintptr_t>(this));
#if defined(__x86_64__) && defined(__GNUC__)
uint32 hi, lo;