summaryrefslogtreecommitdiff
path: root/src/hash.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/hash.h')
-rw-r--r--src/hash.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/hash.h b/src/hash.h
index 3868a4e..50a35b8 100644
--- a/src/hash.h
+++ b/src/hash.h
@@ -17,8 +17,8 @@
17#include "bu/exceptionbase.h" 17#include "bu/exceptionbase.h"
18#include "bu/list.h" 18#include "bu/list.h"
19#include "bu/util.h" 19#include "bu/util.h"
20///#include "archival.h" 20//#include "archival.h"
21///#include "archive.h" 21//#include "archive.h"
22 22
23#define bitsToBytes( n ) (n/32+(n%32>0 ? 1 : 0)) 23#define bitsToBytes( n ) (n/32+(n%32>0 ? 1 : 0))
24 24
@@ -37,6 +37,14 @@ namespace Bu
37 template<typename T> 37 template<typename T>
38 bool __cmpHashKeys( const T &a, const T &b ); 38 bool __cmpHashKeys( const T &a, const T &b );
39 39
40 /**
41 * Default functor used to compute the size of hash tables. This version
42 * effectively doubles the size of the table when space is low, ensuring
43 * that you always wind up with an odd number for the table size. A
44 * better but slower option is to always find the next prime number that's
45 * above double your current table size, but that has the potential to be
46 * slower.
47 */
40 struct __calcNextTSize_fast 48 struct __calcNextTSize_fast
41 { 49 {
42 uint32_t operator()( uint32_t nCapacity, uint32_t, uint32_t nDeleted ) const 50 uint32_t operator()( uint32_t nCapacity, uint32_t, uint32_t nDeleted ) const
@@ -677,7 +685,7 @@ namespace Bu
677 685
678 /** 686 /**
679 * Get the value behind this iterator. 687 * Get the value behind this iterator.
680 *@returs (value_type &) The value behind this iterator. 688 *@returns (value_type &) The value behind this iterator.
681 */ 689 */
682 value &getValue() 690 value &getValue()
683 { 691 {
@@ -804,7 +812,7 @@ namespace Bu
804 812
805 /** 813 /**
806 * Get the value behind this iterator. 814 * Get the value behind this iterator.
807 *@returs (value_type &) The value behind this iterator. 815 *@returns (value_type &) The value behind this iterator.
808 */ 816 */
809 const value &getValue() const 817 const value &getValue() const
810 { 818 {