diff options
Diffstat (limited to '3rdParty/Boost/src/boost/asio/detail/hash_map.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/asio/detail/hash_map.hpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/3rdParty/Boost/src/boost/asio/detail/hash_map.hpp b/3rdParty/Boost/src/boost/asio/detail/hash_map.hpp index 923ae57..c620da7 100644 --- a/3rdParty/Boost/src/boost/asio/detail/hash_map.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/hash_map.hpp @@ -2,7 +2,7 @@ // hash_map.hpp // ~~~~~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -215,6 +215,9 @@ private: // Re-initialise the hash from the values already contained in the list. void rehash(std::size_t num_buckets) { + if (num_buckets == buckets_.size()) + return; + iterator end = values_.end(); // Update number of buckets and initialise all buckets to empty. @@ -231,9 +234,13 @@ private: { buckets_[bucket].first = buckets_[bucket].last = iter++; } + else if (++buckets_[bucket].last == iter) + { + ++iter; + } else { - values_.splice(++buckets_[bucket].last, values_, iter++); + values_.splice(buckets_[bucket].last, values_, iter++); --buckets_[bucket].last; } } @@ -275,6 +282,8 @@ private: // The type for a bucket in the hash table. struct bucket_type { + bucket_type() {} + bucket_type(const bucket_type&) { /* noop */ } iterator first; iterator last; }; |