From 0975d66d2f06603f5e4016440b333aac88e2958a Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 24 Sep 2008 03:22:58 +0000 Subject: Ok, now all the warnings are gone (except for those coming from nids, but that's ok, nids is still in flux, they'll be gone soon). --- src/hash.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/hash.h') diff --git a/src/hash.h b/src/hash.h index 25dc509..2810e35 100644 --- a/src/hash.h +++ b/src/hash.h @@ -39,7 +39,7 @@ namespace Bu struct __calcNextTSize_fast { - uint32_t operator()( uint32_t nCapacity, uint32_t nFill, uint32_t nDeleted ) const + uint32_t operator()( uint32_t nCapacity, uint32_t, uint32_t nDeleted ) const { if( nDeleted >= nCapacity/2 ) return nCapacity; @@ -506,7 +506,7 @@ namespace Bu { uint32_t hash = __calcHashCode( k ); bool bFill; - uint32_t nPos = probe( hash, k, bFill, false ); + uint32_t nPos = probe( hash, k, bFill ); if( bFill ) { @@ -533,6 +533,14 @@ namespace Bu return bFill; } + + virtual bool has( key k ) const + { + bool bFill; + probe( __calcHashCode( k ), k, bFill ); + + return bFill; + } /** * Iteration structure for iterating through the hash. @@ -979,7 +987,7 @@ namespace Bu return nCur; } - uint32_t probe( uint32_t hash, key k, bool &bFill, bool rehash=true ) const + uint32_t probe( uint32_t hash, key k, bool &bFill ) const { uint32_t nCur = hash%nCapacity; -- cgit v1.2.3