aboutsummaryrefslogtreecommitdiff
path: root/src/hash.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-11-21 16:01:57 +0000
committerMike Buland <eichlan@xagasoft.com>2006-11-21 16:01:57 +0000
commit6f6bb9f9309a6d5e471579ec565d56e4d083dafb (patch)
tree5ab79eded3cdf59053e90cf24d977dca31fed495 /src/hash.cpp
parent525b50abe6b5a6e06c2b4ba327c9490de5277a5b (diff)
downloadlibbu++-6f6bb9f9309a6d5e471579ec565d56e4d083dafb.tar.gz
libbu++-6f6bb9f9309a6d5e471579ec565d56e4d083dafb.tar.bz2
libbu++-6f6bb9f9309a6d5e471579ec565d56e4d083dafb.tar.xz
libbu++-6f6bb9f9309a6d5e471579ec565d56e4d083dafb.zip
Added erase functionality, and specializations for using ints as hash keys, so
really it does everything the old one did, does it better, easier, and possibly faster.
Diffstat (limited to '')
-rw-r--r--src/hash.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/hash.cpp b/src/hash.cpp
index 14be208..0241753 100644
--- a/src/hash.cpp
+++ b/src/hash.cpp
@@ -1,5 +1,25 @@
1#include "hash.h" 1#include "hash.h"
2 2
3template<> uint32_t __calcHashCode<const int>( const int k )
4{
5 return k;
6}
7
8template<> bool __cmpHashKeys<const int>( const int a, const int b )
9{
10 return a == b;
11}
12
13template<> uint32_t __calcHashCode<int>( int k )
14{
15 return k;
16}
17
18template<> bool __cmpHashKeys<int>( int a, int b )
19{
20 return a == b;
21}
22
3template<> 23template<>
4uint32_t __calcHashCode<const char *>( const char * k ) 24uint32_t __calcHashCode<const char *>( const char * k )
5{ 25{