diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-11-21 19:00:49 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-11-21 19:00:49 +0000 |
commit | 1ef4ff2655e62fad53c4e67476c531c897b7d583 (patch) | |
tree | 0d3c8713413faed486420dc218593c0cdacf6120 | |
parent | 6f6bb9f9309a6d5e471579ec565d56e4d083dafb (diff) | |
download | libbu++-1ef4ff2655e62fad53c4e67476c531c897b7d583.tar.gz libbu++-1ef4ff2655e62fad53c4e67476c531c897b7d583.tar.bz2 libbu++-1ef4ff2655e62fad53c4e67476c531c897b7d583.tar.xz libbu++-1ef4ff2655e62fad53c4e67476c531c897b7d583.zip |
Updated a thing.
-rw-r--r-- | src/hash.h | 23 |
1 files changed, 9 insertions, 14 deletions
@@ -26,7 +26,7 @@ struct __calcNextTSize_fast | |||
26 | template<typename key, typename value, typename sizecalc = __calcNextTSize_fast, typename keyalloc = std::allocator<key>, typename valuealloc = std::allocator<value>, typename challoc = std::allocator<uint32_t> > | 26 | template<typename key, typename value, typename sizecalc = __calcNextTSize_fast, typename keyalloc = std::allocator<key>, typename valuealloc = std::allocator<value>, typename challoc = std::allocator<uint32_t> > |
27 | class Hash; | 27 | class Hash; |
28 | 28 | ||
29 | template< typename key, typename _value, typename sizecalc, typename keyalloc, typename valuealloc, typename challoc > | 29 | template< typename key, typename _value, typename sizecalc = __calcNextTSize_fast, typename keyalloc = std::allocator<key>, typename valuealloc = std::allocator<_value>, typename challoc = std::allocator<uint32_t> > |
30 | struct HashProxy | 30 | struct HashProxy |
31 | { | 31 | { |
32 | friend class Hash<key, _value, sizecalc, keyalloc, valuealloc, challoc>; | 32 | friend class Hash<key, _value, sizecalc, keyalloc, valuealloc, challoc>; |
@@ -139,19 +139,6 @@ public: | |||
139 | ca.deallocate( aHashCodes, nCapacity ); | 139 | ca.deallocate( aHashCodes, nCapacity ); |
140 | } | 140 | } |
141 | 141 | ||
142 | void clearBits() | ||
143 | { | ||
144 | for( uint32_t j = 0; j < nKeysSize; j++ ) | ||
145 | { | ||
146 | bFilled[j] = bDeleted[j] = 0; | ||
147 | } | ||
148 | } | ||
149 | |||
150 | int hasKey( key keyval ) | ||
151 | { | ||
152 | printf("%s\n", keyval ); | ||
153 | } | ||
154 | |||
155 | uint32_t getCapacity() | 142 | uint32_t getCapacity() |
156 | { | 143 | { |
157 | return nCapacity; | 144 | return nCapacity; |
@@ -307,6 +294,14 @@ public: | |||
307 | } | 294 | } |
308 | 295 | ||
309 | private: | 296 | private: |
297 | void clearBits() | ||
298 | { | ||
299 | for( uint32_t j = 0; j < nKeysSize; j++ ) | ||
300 | { | ||
301 | bFilled[j] = bDeleted[j] = 0; | ||
302 | } | ||
303 | } | ||
304 | |||
310 | void fill( uint32_t loc, key &k, value &v, uint32_t hash ) | 305 | void fill( uint32_t loc, key &k, value &v, uint32_t hash ) |
311 | { | 306 | { |
312 | bFilled[loc/32] |= (1<<(loc%32)); | 307 | bFilled[loc/32] |= (1<<(loc%32)); |