summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-02-17 15:58:47 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 19:10:15 -0300
commit23e950c9a2c9ac493d539f892c5051f703004d32 (patch)
treebc57374d19786787dcacc953ba992b3eadda5f83
parent2b671a5452d9f8c528948e4dcd707a11d3b8962b (diff)
Turn some regex static, so we don't need to compile them in every function call.sb-0.10.0
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
-rw-r--r--abstractmetalang.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/abstractmetalang.cpp b/abstractmetalang.cpp
index b1f5fd6e..24aaa68b 100644
--- a/abstractmetalang.cpp
+++ b/abstractmetalang.cpp
@@ -751,7 +751,7 @@ bool AbstractMetaFunction::hasSignatureModifications() const
bool AbstractMetaFunction::isConversionOperator(QString funcName)
{
- QRegExp opRegEx("^operator(?:\\s+(?:const|volatile))?\\s+(\\w+\\s*)&?$");
+ static QRegExp opRegEx("^operator(?:\\s+(?:const|volatile))?\\s+(\\w+\\s*)&?$");
return opRegEx.indexIn(funcName) > -1;
}
@@ -760,7 +760,7 @@ bool AbstractMetaFunction::isOperatorOverload(QString funcName)
if (isConversionOperator(funcName))
return true;
- QRegExp opRegEx("^operator([+\\-\\*/%=&\\|\\^\\<>!][=]?"
+ static QRegExp opRegEx("^operator([+\\-\\*/%=&\\|\\^\\<>!][=]?"
"|\\+\\+|\\-\\-|&&|\\|\\||<<[=]?|>>[=]?|~"
"|\\[\\]|\\s+delete\\[?\\]?"
"|\\(\\)"