summaryrefslogtreecommitdiffstats
path: root/src/searchindex.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2021-02-15 19:30:22 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2021-02-20 19:17:51 (GMT)
commitbb99814ff2eeb0c916a4c5d632bd0c03e3e7ba96 (patch)
treeed1c433dc6923aa17f8904d6801f63c7e06a9be5 /src/searchindex.cpp
parentf27dbdbbbae00c8862a5cb434ae3a7cd58035d39 (diff)
downloadDoxygen-bb99814ff2eeb0c916a4c5d632bd0c03e3e7ba96.zip
Doxygen-bb99814ff2eeb0c916a4c5d632bd0c03e3e7ba96.tar.gz
Doxygen-bb99814ff2eeb0c916a4c5d632bd0c03e3e7ba96.tar.bz2
Refactoring: remove QRegExp in searchindex.cpp
Diffstat (limited to 'src/searchindex.cpp')
-rw-r--r--src/searchindex.cpp11
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);
}