aboutsummaryrefslogtreecommitdiff
path: root/src/old/hashfunctionstring.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-04-03 05:10:59 +0000
committerMike Buland <eichlan@xagasoft.com>2007-04-03 05:10:59 +0000
commit997f13ec4791adcda91cd4db41cdb5962b73d47d (patch)
tree8207c21db09f988e58684d70629d2405dc844eda /src/old/hashfunctionstring.cpp
parentc884da672645231b5ec47706c886381dab1b391a (diff)
downloadlibbu++-997f13ec4791adcda91cd4db41cdb5962b73d47d.tar.gz
libbu++-997f13ec4791adcda91cd4db41cdb5962b73d47d.tar.bz2
libbu++-997f13ec4791adcda91cd4db41cdb5962b73d47d.tar.xz
libbu++-997f13ec4791adcda91cd4db41cdb5962b73d47d.zip
Just deleted a few things from old that definately have to go.
Diffstat (limited to 'src/old/hashfunctionstring.cpp')
-rw-r--r--src/old/hashfunctionstring.cpp51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/old/hashfunctionstring.cpp b/src/old/hashfunctionstring.cpp
deleted file mode 100644
index bd14643..0000000
--- a/src/old/hashfunctionstring.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
1#include "hashfunctionstring.h"
2#ifndef NULL
3#define NULL ((void *) 0)
4#endif
5
6HashFunctionString::HashFunctionString()
7{
8}
9
10HashFunctionString::~HashFunctionString()
11{
12}
13
14unsigned long int HashFunctionString::hash( const void *id )
15{
16 if (id == NULL)
17 {
18 return 0;
19 }
20
21 unsigned long int nPos = 0;
22 for( const char *s = (const char *)id; *s; s++ )
23 {
24 nPos = *s + (nPos << 6) + (nPos << 16) - nPos;
25 }
26 return nPos;
27}
28
29bool HashFunctionString::cmpIDs( const void *id1, const void *id2 )
30{
31 if (id1 == NULL || id2 == NULL)
32 {
33 return false;
34 }
35 if (id1 == id2)
36 {
37 return true;
38 }
39
40 const char *str1 = (const char *)id1;
41 const char *str2 = (const char *)id2;
42
43 int j;
44 for( j = 0; str1[j] != '\0' && str2[j] != '\0'; j++ )
45 {
46 if( str1[j] != str2[j] )
47 return false;
48 }
49 return (str1[j]==str2[j]);
50}
51