diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-11-21 16:01:57 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-11-21 16:01:57 +0000 |
commit | 6f6bb9f9309a6d5e471579ec565d56e4d083dafb (patch) | |
tree | 5ab79eded3cdf59053e90cf24d977dca31fed495 /src/hash.cpp | |
parent | 525b50abe6b5a6e06c2b4ba327c9490de5277a5b (diff) | |
download | libbu++-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 'src/hash.cpp')
-rw-r--r-- | src/hash.cpp | 20 |
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 | ||
3 | template<> uint32_t __calcHashCode<const int>( const int k ) | ||
4 | { | ||
5 | return k; | ||
6 | } | ||
7 | |||
8 | template<> bool __cmpHashKeys<const int>( const int a, const int b ) | ||
9 | { | ||
10 | return a == b; | ||
11 | } | ||
12 | |||
13 | template<> uint32_t __calcHashCode<int>( int k ) | ||
14 | { | ||
15 | return k; | ||
16 | } | ||
17 | |||
18 | template<> bool __cmpHashKeys<int>( int a, int b ) | ||
19 | { | ||
20 | return a == b; | ||
21 | } | ||
22 | |||
3 | template<> | 23 | template<> |
4 | uint32_t __calcHashCode<const char *>( const char * k ) | 24 | uint32_t __calcHashCode<const char *>( const char * k ) |
5 | { | 25 | { |