summaryrefslogtreecommitdiffstats
path: root/src/template.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2021-03-02 20:40:36 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2021-03-02 21:35:36 (GMT)
commit3d4f0313d20cc8f71ade094faa006a2171ff29c2 (patch)
tree0d84aff63e7b1bbd7bc46891771a90bc64ee58dc /src/template.cpp
parent30d347bf8046775d6eab9bd8f70dbf3c3204e7b7 (diff)
downloadDoxygen-3d4f0313d20cc8f71ade094faa006a2171ff29c2.zip
Doxygen-3d4f0313d20cc8f71ade094faa006a2171ff29c2.tar.gz
Doxygen-3d4f0313d20cc8f71ade094faa006a2171ff29c2.tar.bz2
Refactoring: replaced std::regex with own much faster implementation
Diffstat (limited to 'src/template.cpp')
-rw-r--r--src/template.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/template.cpp b/src/template.cpp
index 4c296aa..9f1eb92 100644
--- a/src/template.cpp
+++ b/src/template.cpp
@@ -20,7 +20,6 @@
#include <unordered_map>
#include <deque>
#include <cstdio>
-#include <regex>
#include <qfile.h>
#include <qdir.h>
@@ -30,6 +29,7 @@
#include "util.h"
#include "resourcemgr.h"
#include "portable.h"
+#include "regex.h"
#define ENABLE_TRACING 0
@@ -4186,9 +4186,9 @@ class TemplateNodeMarkers : public TemplateNodeCreator<TemplateNodeMarkers>
c->push();
std::string str = patternStr.toString().str();
- static const std::regex marker("@([[:digit:]]+)", std::regex::optimize);
- std::sregex_iterator re_it(str.begin(),str.end(),marker);
- std::sregex_iterator end;
+ static const reg::Ex marker(R"(@\d+)");
+ reg::Iterator re_it(str,marker);
+ reg::Iterator end;
size_t index=0;
for ( ; re_it!=end ; ++re_it)
{
@@ -4204,7 +4204,7 @@ class TemplateNodeMarkers : public TemplateNodeCreator<TemplateNodeMarkers>
{
ts << part; // write text before marker
}
- unsigned long entryIndex = std::stoul(match[1].str());
+ unsigned long entryIndex = std::stoul(match.str().substr(1));
TemplateVariant var;
size_t i=0;
// search for list element at position id