Refactoring on {global,ip,resources,session,tx,user} collections

Now using the same name schema and interface for these "special"
collection.

Fix: #1754, #1778
This commit is contained in:
Felipe Zimmerle
2018-05-29 23:48:05 -03:00
parent 550e9d3f39
commit 892beb5360
7 changed files with 66 additions and 43 deletions

View File

@@ -105,9 +105,10 @@ void InMemoryPerProcess::resolveMultiMatches(const std::string& var,
l->insert(l->begin(), new VariableValue(&m_name, &i.first, &i.second));
}
} else {
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));
for (auto &a : *this) {
if (a.first.compare(0, var.size(), var) == 0) {
l->insert(l->begin(), new VariableValue(&m_name, &var, &a.second));
}
}
}
}
@@ -116,7 +117,6 @@ void InMemoryPerProcess::resolveMultiMatches(const std::string& var,
void InMemoryPerProcess::resolveRegularExpression(const std::string& var,
std::vector<const VariableValue *> *l) {
//if (var.find(":") == std::string::npos) {
// return;
//}