diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2021-02-15 19:30:22 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2021-02-20 19:17:51 (GMT) |
commit | bb99814ff2eeb0c916a4c5d632bd0c03e3e7ba96 (patch) | |
tree | ed1c433dc6923aa17f8904d6801f63c7e06a9be5 /src | |
parent | f27dbdbbbae00c8862a5cb434ae3a7cd58035d39 (diff) | |
download | Doxygen-bb99814ff2eeb0c916a4c5d632bd0c03e3e7ba96.zip Doxygen-bb99814ff2eeb0c916a4c5d632bd0c03e3e7ba96.tar.gz Doxygen-bb99814ff2eeb0c916a4c5d632bd0c03e3e7ba96.tar.bz2 |
Refactoring: remove QRegExp in searchindex.cpp
Diffstat (limited to 'src')
-rw-r--r-- | src/searchindex.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/searchindex.cpp b/src/searchindex.cpp index 89f1681..61d2d6c 100644 --- a/src/searchindex.cpp +++ b/src/searchindex.cpp @@ -18,7 +18,6 @@ #include <assert.h> #include <qfile.h> -#include <qregexp.h> #include "searchindex.h" #include "config.h" @@ -200,7 +199,6 @@ static int charsToIndex(const char *word) void SearchIndex::addWord(const char *word,bool hiPriority,bool recurse) { - static QRegExp nextPart("[_a-z:][A-Z]"); if (word==0 || word[0]=='\0') return; QCString wStr = QCString(word).lower(); //printf("SearchIndex::addWord(%s,%d) wStr=%s\n",word,hiPriority,wStr.data()); @@ -227,7 +225,14 @@ void SearchIndex::addWord(const char *word,bool hiPriority,bool recurse) } if (!found) // no prefix stripped { - if ((i=nextPart.match(word))>=1) + i=0; + while (word[i]!=0 && + !((word[i]=='_' || word[i]==':' || (word[i]>='a' && word[i]<='z')) && // [_a-z:] + (word[i+1]>='A' && word[i+1]<='Z'))) // [A-Z] + { + i++; + } + if (word[i]!=0 && i>=1) { addWord(word+i+1,hiPriority,TRUE); } |