Performance improvement while expanding macros

This commit is contained in:
Felipe Zimmerle 2015-10-15 14:04:35 -03:00
parent 3351338551
commit 74045beab5

View File

@ -34,9 +34,15 @@ std::string MacroExpansion::expandKeepOriginal(const std::string& input,
std::string MacroExpansion::expand(const std::string& input, Assay *assay) {
std::string res(input);
std::string res;
size_t pos = input.find("%{");
if (pos != std::string::npos) {
res = input;
} else {
return input;
}
size_t pos = res.find("%{");
while (pos != std::string::npos) {
size_t start = pos;
size_t end = res.find("}");