diff options
Diffstat (limited to '')
-rw-r--r-- | src/hash.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -856,7 +856,8 @@ namespace Bu | |||
856 | 856 | ||
857 | // First we scan to see if the key is already there, abort if we | 857 | // First we scan to see if the key is already there, abort if we |
858 | // run out of probing room, or we find a non-filled entry | 858 | // run out of probing room, or we find a non-filled entry |
859 | for( int8_t j = 0; | 859 | int8_t j; |
860 | for( j = 0; | ||
860 | isFilled( nCur ) && j < 32; | 861 | isFilled( nCur ) && j < 32; |
861 | nCur = (nCur + (1<<j))%nCapacity, j++ | 862 | nCur = (nCur + (1<<j))%nCapacity, j++ |
862 | ) | 863 | ) |
@@ -880,7 +881,7 @@ namespace Bu | |||
880 | 881 | ||
881 | // This is our insurance, if the table is full, then go ahead and | 882 | // This is our insurance, if the table is full, then go ahead and |
882 | // rehash, then try again. | 883 | // rehash, then try again. |
883 | if( isFilled( nCur ) && rehash == true ) | 884 | if( (isFilled( nCur ) || j == 32) && rehash == true ) |
884 | { | 885 | { |
885 | reHash( szCalc(getCapacity(), getFill(), getDeleted()) ); | 886 | reHash( szCalc(getCapacity(), getFill(), getDeleted()) ); |
886 | 887 | ||