From 1edeb655a693fab36cba6c48ceafc2a6f2ff98a0 Mon Sep 17 00:00:00 2001 From: florijan <florijan@memgraph.io> Date: Mon, 9 Apr 2018 11:25:11 +0200 Subject: [PATCH] Return PropertyValue from store by value Summary: Do it so properties-on-disk can be implemented. Reviewers: buda, dgleich Reviewed By: dgleich Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D1343 --- src/storage/property_value_store.hpp | 2 +- src/storage/record_accessor.cpp | 2 +- src/storage/record_accessor.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/storage/property_value_store.hpp b/src/storage/property_value_store.hpp index 4b68d78a3..18ebbfe42 100644 --- a/src/storage/property_value_store.hpp +++ b/src/storage/property_value_store.hpp @@ -27,7 +27,7 @@ class PropertyValueStore { * @param key The key for which a PropertyValue is sought. * @return See above. */ - const PropertyValue &at(const Property &key) const { + PropertyValue at(const Property &key) const { for (const auto &kv : props_) if (kv.first == key) return kv.second; diff --git a/src/storage/record_accessor.cpp b/src/storage/record_accessor.cpp index e5b826a5f..5e1d90416 100644 --- a/src/storage/record_accessor.cpp +++ b/src/storage/record_accessor.cpp @@ -20,7 +20,7 @@ RecordAccessor<TRecord>::RecordAccessor(AddressT address, } template <typename TRecord> -const PropertyValue &RecordAccessor<TRecord>::PropsAt( +PropertyValue RecordAccessor<TRecord>::PropsAt( storage::Property key) const { return current().properties_.at(key); } diff --git a/src/storage/record_accessor.hpp b/src/storage/record_accessor.hpp index 39689bbc4..5b298ab16 100644 --- a/src/storage/record_accessor.hpp +++ b/src/storage/record_accessor.hpp @@ -55,7 +55,7 @@ class RecordAccessor : public TotalOrdering<RecordAccessor<TRecord>> { RecordAccessor &operator=(RecordAccessor &&other) = default; /** Gets the property for the given key. */ - const PropertyValue &PropsAt(storage::Property key) const; + PropertyValue PropsAt(storage::Property key) const; /** Sets a value on the record for the given property. */ void PropsSet(storage::Property key, PropertyValue value);