diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2005-05-08 21:32:24 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2005-05-08 21:32:24 (GMT) |
commit | 23885c2f2db71f003578f0d1b44555c067bfd7a5 (patch) | |
tree | c4bbe961812e7008b9e85fd820596290c043c0f6 /src/searchindex.cpp | |
parent | 5d31b7ab211586100301d6838be82f066f8f9af4 (diff) | |
download | Doxygen-23885c2f2db71f003578f0d1b44555c067bfd7a5.zip Doxygen-23885c2f2db71f003578f0d1b44555c067bfd7a5.tar.gz Doxygen-23885c2f2db71f003578f0d1b44555c067bfd7a5.tar.bz2 |
Release-1.4.2-20050508
Diffstat (limited to 'src/searchindex.cpp')
-rw-r--r-- | src/searchindex.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/searchindex.cpp b/src/searchindex.cpp index 5bf510f..400702b 100644 --- a/src/searchindex.cpp +++ b/src/searchindex.cpp @@ -80,20 +80,22 @@ static int charsToIndex(const char *word) { if (word==0) return -1; - register ushort h=0; - const char *k = word; - ushort mask=0xfc00; - while ( *k ) - { - h = (h&mask)^(h<<6)^(*k++); - } + // Fast string hashing algorithm + //register ushort h=0; + //const char *k = word; + //ushort mask=0xfc00; + //while ( *k ) + //{ + // h = (h&mask)^(h<<6)^(*k++); + //} + //return h; - //uint c1=word[0]; - //if (c1==0) return -1; - //uint c2=word[1]; - //if (c2==0) return -1; - //return c1*256+c2; - return h; + // Simple hashing that allows for substring searching + uint c1=word[0]; + if (c1==0) return -1; + uint c2=word[1]; + if (c2==0) return -1; + return c1*256+c2; } void SearchIndex::addWord(const char *word,bool hiPriority) |