From f5ac2c1ba333ce6aa6d385d9a63b658caaa46503 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sat, 18 Aug 2012 23:43:21 +0000 Subject: Added hashtable += support, optomized the random number base some? --- src/stable/hash.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/stable/hash.h') diff --git a/src/stable/hash.h b/src/stable/hash.h index e461cf5..86f189e 100644 --- a/src/stable/hash.h +++ b/src/stable/hash.h @@ -1212,6 +1212,21 @@ namespace Bu return !(*this == rhs); } + MyType &operator+=( const MyType &rhs ) + { + if( this == &rhs ) + return *this; + if( core == rhs.core ) + return *this; + if( core == NULL || rhs.core == NULL ) + return *this; + + for( const_iterator i = rhs.begin(); i; i++ ) + insert( i.getKey(), i.getValue() ); + + return *this; + } + protected: virtual Core *_copyCore( Core *src ) { -- cgit v1.2.3