summaryrefslogtreecommitdiff
path: root/src/hash.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2010-04-07 17:44:57 +0000
committerMike Buland <eichlan@xagasoft.com>2010-04-07 17:44:57 +0000
commit943cf16f5661357086532b2241e6f85bfe43565a (patch)
tree6ef615680835ea0415becf62387168a31cb36b32 /src/hash.h
parent6cdf5615a2729df486def3fae2e6f548a34fb83b (diff)
downloadlibbu++-943cf16f5661357086532b2241e6f85bfe43565a.tar.gz
libbu++-943cf16f5661357086532b2241e6f85bfe43565a.tar.bz2
libbu++-943cf16f5661357086532b2241e6f85bfe43565a.tar.xz
libbu++-943cf16f5661357086532b2241e6f85bfe43565a.zip
Corrected a long standing yet seldom witnessed hash bug. It was triggered when
a hashtable was filled, then some items were removed, then enough items were added to trigger a rehash.
Diffstat (limited to 'src/hash.h')
-rw-r--r--src/hash.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/hash.h b/src/hash.h
index cb3001a..1cb539b 100644
--- a/src/hash.h
+++ b/src/hash.h
@@ -1115,7 +1115,8 @@ namespace Bu
1115 // Delete all of the old data 1115 // Delete all of the old data
1116 for( uint32_t j = 0; j < nOldCapacity; j++ ) 1116 for( uint32_t j = 0; j < nOldCapacity; j++ )
1117 { 1117 {
1118 if( (bOldFilled[j/32]&(1<<(j%32)))!=0 ) 1118 if( (bOldFilled[j/32]&(1<<(j%32)))!=0 &&
1119 (bOldDeleted[j/32]&(1<<(j%32)))==0 )
1119 { 1120 {
1120 va.destroy( &aOldValues[j] ); 1121 va.destroy( &aOldValues[j] );
1121 ka.destroy( &aOldKeys[j] ); 1122 ka.destroy( &aOldKeys[j] );