#1818: Variable names must match fully, not partially; also revert to hash table lookup instead of linear search; add test case

This commit is contained in:
michaelgranzow-avi
2018-06-26 13:54:11 +02:00
committed by Felipe Zimmerle
parent 65aa7ae5e2
commit d810de9166
2 changed files with 42 additions and 4 deletions

View File

@@ -105,10 +105,9 @@ void InMemoryPerProcess::resolveMultiMatches(const std::string& var,
l->insert(l->begin(), new VariableValue(&m_name, &i.first, &i.second));
}
} else {
for (auto &a : *this) {
if (a.first.compare(0, var.size(), var) == 0) {
l->insert(l->begin(), new VariableValue(&m_name, &var, &a.second));
}
auto range = this->equal_range(var);
for (auto it = range.first; it != range.second; ++it) {
l->insert(l->begin(), new VariableValue(&m_name, &var, &it->second));
}
}
}