Eliminate repeated lookup
This commit is contained in:
parent
423b254772
commit
be49abf460
|
@ -1840,8 +1840,9 @@ std::string Preprocessor::getcode(const std::string &filedata, const std::string
|
||||||
cfgmap[line.substr(8)] = "";
|
cfgmap[line.substr(8)] = "";
|
||||||
else if (line[pos] == ' ') {
|
else if (line[pos] == ' ') {
|
||||||
std::string value(line.substr(pos + 1));
|
std::string value(line.substr(pos + 1));
|
||||||
if (cfgmap.find(value) != cfgmap.end())
|
std::map<std::string, std::string>::const_iterator cfgpos = cfgmap.find(value);
|
||||||
value = cfgmap[value];
|
if (cfgpos != cfgmap.end())
|
||||||
|
value = cfgpos->second;
|
||||||
cfgmap[line.substr(8, pos - 8)] = value;
|
cfgmap[line.substr(8, pos - 8)] = value;
|
||||||
} else
|
} else
|
||||||
cfgmap[line.substr(8, pos - 8)] = "";
|
cfgmap[line.substr(8, pos - 8)] = "";
|
||||||
|
|
Loading…
Reference in New Issue