diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2005-04-10 18:36:52 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2005-04-10 18:36:52 (GMT) |
commit | 570375c30adbdb66714d465d849b18e0df9dd6e6 (patch) | |
tree | a604824ba5bbf13dd607ebd57c1a426a0d225d58 /src/searchindex.cpp | |
parent | 4fa6a6049a696a55520a0537192697798f29602d (diff) | |
download | Doxygen-570375c30adbdb66714d465d849b18e0df9dd6e6.zip Doxygen-570375c30adbdb66714d465d849b18e0df9dd6e6.tar.gz Doxygen-570375c30adbdb66714d465d849b18e0df9dd6e6.tar.bz2 |
Release-1.4.2-20050410
Diffstat (limited to 'src/searchindex.cpp')
-rw-r--r-- | src/searchindex.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/searchindex.cpp b/src/searchindex.cpp index 752d4a9..5bf510f 100644 --- a/src/searchindex.cpp +++ b/src/searchindex.cpp @@ -19,6 +19,7 @@ #include "searchindex.h" #include "config.h" #include <qfile.h> +#include <ctype.h> // file format: (all multi-byte values are stored in big endian format) @@ -75,15 +76,24 @@ void SearchIndex::setCurrentDoc(const char *name,const char *baseName,const char m_urls.insert(m_urlIndex,new URL(name,url)); } - static int charsToIndex(const char *word) { if (word==0) return -1; - uint c1=word[0]; - if (c1==0) return -1; - uint c2=word[1]; - if (c2==0) return -1; - return c1*256+c2; + + register ushort h=0; + const char *k = word; + ushort mask=0xfc00; + while ( *k ) + { + h = (h&mask)^(h<<6)^(*k++); + } + + //uint c1=word[0]; + //if (c1==0) return -1; + //uint c2=word[1]; + //if (c2==0) return -1; + //return c1*256+c2; + return h; } void SearchIndex::addWord(const char *word,bool hiPriority) @@ -91,6 +101,7 @@ void SearchIndex::addWord(const char *word,bool hiPriority) //printf("SearchIndex::addWord(%s,%d)\n",word,hiPriority); //QString wStr=QString(word).lower(); QString wStr(word); + wStr=wStr.lower(); if (wStr.isEmpty()) return; IndexWord *w = m_words[wStr]; if (w==0) |