Use Allocator for map in TypedValue

Reviewers: mtomic, llugovic, mferencevic

Reviewed By: llugovic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2116
This commit is contained in:
Teon Banek
2019-06-03 16:54:20 +02:00
parent 0b2240e6e4
commit 96505b7fb4
8 changed files with 138 additions and 47 deletions

View File

@@ -184,7 +184,7 @@ class ExpressionEvaluator : public ExpressionVisitor<TypedValue> {
throw QueryRuntimeException("Expected a string as a map index, got {}.",
index.type());
const auto &map = lhs.ValueMap();
auto found = map.find(std::string(index.ValueString()));
auto found = map.find(index.ValueString());
if (found == map.end()) return TypedValue::Null;
return found->second;
}
@@ -276,8 +276,8 @@ class ExpressionEvaluator : public ExpressionVisitor<TypedValue> {
return expression_result.Value<EdgeAccessor>().PropsAt(
GetProperty(property_lookup.property_));
case TypedValue::Type::Map: {
auto &map = expression_result.ValueMap();
auto found = map.find(property_lookup.property_.name);
const auto &map = expression_result.ValueMap();
auto found = map.find(property_lookup.property_.name.c_str());
if (found == map.end()) return TypedValue::Null;
return found->second;
}