From 2f132d1d2c39d65bf03dc0234977366f13dc38f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Dumont?= Date: Thu, 30 Apr 2015 07:13:37 +0000 Subject: hashtable_policy.h (_Prime_rehash_policy::_S_n_primes): Delete. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2015-04-30 François Dumont * include/bits/hashtable_policy.h (_Prime_rehash_policy::_S_n_primes): Delete. * src/c++11/hashtable_c++0x.cc (_Prime_rehash_policy::_M_next_bkt): Remove usage of latter and compute size of the prime numbers array locally. From-SVN: r222611 --- libstdc++-v3/src/c++11/hashtable_c++0x.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libstdc++-v3/src') diff --git a/libstdc++-v3/src/c++11/hashtable_c++0x.cc b/libstdc++-v3/src/c++11/hashtable_c++0x.cc index 22de51b..69f999f 100644 --- a/libstdc++-v3/src/c++11/hashtable_c++0x.cc +++ b/libstdc++-v3/src/c++11/hashtable_c++0x.cc @@ -56,8 +56,10 @@ namespace __detail return __fast_bkt[__n]; } + constexpr auto __n_primes + = sizeof(__prime_list) / sizeof(unsigned long) - 1; const unsigned long* __next_bkt = - std::lower_bound(__prime_list + 5, __prime_list + _S_n_primes, __n); + std::lower_bound(__prime_list + 5, __prime_list + __n_primes, __n); _M_next_resize = __builtin_ceil(*__next_bkt * (long double)_M_max_load_factor); return *__next_bkt; -- cgit v1.1