Cache search result to avoid dual search
This commit is contained in:
parent
0818102758
commit
b17f2eea16
|
@ -7526,8 +7526,9 @@ public:
|
|||
|
||||
void simplify(const std::map<std::string, EnumValue> &enumValues) {
|
||||
for (Token *tok = start; tok; tok = tok->next()) {
|
||||
if (enumValues.find(tok->str()) != enumValues.end()) {
|
||||
const EnumValue &other = enumValues.find(tok->str())->second;
|
||||
std::map<std::string, EnumValue>::const_iterator it = enumValues.find(tok->str());
|
||||
if (it != enumValues.end()) {
|
||||
const EnumValue &other = it->second;
|
||||
if (other.value != nullptr)
|
||||
tok->str(other.value->str());
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue