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 | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/3rdParty/Boost/src/boost/asio/detail/hash_map.hpp b/3rdParty/Boost/src/boost/asio/detail/hash_map.hpp index 4f4eed3..339ab9d 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 @@ // detail/hash_map.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2012 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) @@ -16,7 +16,7 @@ #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include <boost/asio/detail/config.hpp> -#include <cassert> +#include <boost/assert.hpp> #include <list> #include <utility> #include <boost/asio/detail/noncopyable.hpp> @@ -117,9 +117,9 @@ public: iterator it = buckets_[bucket].first; if (it == values_.end()) return values_.end(); - iterator end = buckets_[bucket].last; - ++end; - while (it != end) + iterator end_it = buckets_[bucket].last; + ++end_it; + while (it != end_it) { if (it->first == k) return it; @@ -138,9 +138,9 @@ public: const_iterator it = buckets_[bucket].first; if (it == values_.end()) return it; - const_iterator end = buckets_[bucket].last; - ++end; - while (it != end) + const_iterator end_it = buckets_[bucket].last; + ++end_it; + while (it != end_it) { if (it->first == k) return it; @@ -164,15 +164,15 @@ public: ++size_; return std::pair<iterator, bool>(buckets_[bucket].last, true); } - iterator end = buckets_[bucket].last; - ++end; - while (it != end) + iterator end_it = buckets_[bucket].last; + ++end_it; + while (it != end_it) { if (it->first == v.first) return std::pair<iterator, bool>(it, false); ++it; } - buckets_[bucket].last = values_insert(end, v); + buckets_[bucket].last = values_insert(end_it, v); ++size_; return std::pair<iterator, bool>(buckets_[bucket].last, true); } @@ -180,7 +180,7 @@ public: // Erase an entry from the map. void erase(iterator it) { - assert(it != values_.end()); + BOOST_ASSERT(it != values_.end()); size_t bucket = calculate_hash_value(it->first) % num_buckets_; bool is_first = (it == buckets_[bucket].first); @@ -212,9 +212,9 @@ public: size_ = 0; // Initialise all buckets to empty. - iterator end = values_.end(); + iterator end_it = values_.end(); for (size_t i = 0; i < num_buckets_; ++i) - buckets_[i].first = buckets_[i].last = end; + buckets_[i].first = buckets_[i].last = end_it; } private: @@ -245,21 +245,21 @@ private: return; num_buckets_ = num_buckets; - iterator end = values_.end(); + iterator end_iter = values_.end(); // Update number of buckets and initialise all buckets to empty. bucket_type* tmp = new bucket_type[num_buckets_]; delete[] buckets_; buckets_ = tmp; for (std::size_t i = 0; i < num_buckets_; ++i) - buckets_[i].first = buckets_[i].last = end; + buckets_[i].first = buckets_[i].last = end_iter; // Put all values back into the hash. iterator iter = values_.begin(); - while (iter != end) + while (iter != end_iter) { std::size_t bucket = calculate_hash_value(iter->first) % num_buckets_; - if (buckets_[bucket].last == end) + if (buckets_[bucket].last == end_iter) { buckets_[bucket].first = buckets_[bucket].last = iter++; } |