Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2007-12-20 16:27:47


Author: danieljames
Date: 2007-12-20 16:27:46 EST (Thu, 20 Dec 2007)
New Revision: 42219
URL: http://svn.boost.org/trac/boost/changeset/42219

Log:
Use node_count to implement group_count.
Text files modified:
   branches/unordered/dev/boost/unordered/detail/hash_table_impl.hpp | 12 +++---------
   1 files changed, 3 insertions(+), 9 deletions(-)

Modified: branches/unordered/dev/boost/unordered/detail/hash_table_impl.hpp
==============================================================================
--- branches/unordered/dev/boost/unordered/detail/hash_table_impl.hpp (original)
+++ branches/unordered/dev/boost/unordered/detail/hash_table_impl.hpp 2007-12-20 16:27:46 EST (Thu, 20 Dec 2007)
@@ -465,7 +465,7 @@
             // Bucket Size
 
             // no throw
- size_type node_count(link_ptr it) const
+ static inline size_type node_count(link_ptr it)
             {
                 size_type count = 0;
                 while(BOOST_UNORDERED_BORLAND_BOOL(it)) {
@@ -475,7 +475,7 @@
                 return count;
             }
 
- size_type node_count(link_ptr it1, link_ptr it2) const
+ static inline size_type node_count(link_ptr it1, link_ptr it2)
             {
                 size_type count = 0;
                 while(it1 != it2) {
@@ -493,13 +493,7 @@
 #if BOOST_UNORDERED_EQUIVALENT_KEYS
             static size_type group_count(link_ptr it)
             {
- size_type count = 0;
- link_ptr first = it;
- do {
- ++count;
- it = prev_in_group(it);
- } while (it != first); // throws, strong
- return count;
+ return node_count(it, next_group(it));
             }
 #else
             static size_type group_count(link_ptr)


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk