From 36fb7f9554ae50ae4a943684ac3baef860693526 Mon Sep 17 00:00:00 2001 From: florijan Date: Tue, 12 Sep 2017 14:41:18 +0200 Subject: [PATCH] PropertyValueStore - remove Accept function (never used, never will be) Reviewers: buda Reviewed By: buda Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D781 --- src/storage/property_value_store.hpp | 14 -------------- src/storage/record_accessor.cpp | 9 --------- tests/unit/property_value_store.cpp | 26 -------------------------- 3 files changed, 49 deletions(-) diff --git a/src/storage/property_value_store.hpp b/src/storage/property_value_store.hpp index a6dff01d1..71779eee0 100644 --- a/src/storage/property_value_store.hpp +++ b/src/storage/property_value_store.hpp @@ -127,20 +127,6 @@ class PropertyValueStore { */ auto end() const { return props_.end(); } - /** - * Accepts two functions. - * - * @param handler Called for each PropertyValue in this collection. - * @param finish Called once in the end. - */ - void Accept(std::function handler, - std::function finish = {}) const { - if (handler) - for (const auto &prop : props_) handler(prop.first, prop.second); - - if (finish) finish(); - } - private: std::vector> props_; }; diff --git a/src/storage/record_accessor.cpp b/src/storage/record_accessor.cpp index 0116c975b..269da9e86 100644 --- a/src/storage/record_accessor.cpp +++ b/src/storage/record_accessor.cpp @@ -33,15 +33,6 @@ const PropertyValueStore return current().properties_; } -template -void RecordAccessor::PropertiesAccept( - std::function - handler, - std::function finish) const { - current().properties_.Accept(handler, finish); -} - template GraphDbAccessor &RecordAccessor::db_accessor() const { return *db_accessor_; diff --git a/tests/unit/property_value_store.cpp b/tests/unit/property_value_store.cpp index dc461e7ae..bbfe48f47 100644 --- a/tests/unit/property_value_store.cpp +++ b/tests/unit/property_value_store.cpp @@ -104,32 +104,6 @@ TEST(PropertyValueStore, Size) { EXPECT_EQ(props.size(), 100); } -TEST(PropertyValueStore, Accept) { - int count_props = 0; - int count_finish = 0; - - auto handler = [&](const uint32_t, const PropertyValue &) { - count_props += 1; - }; - auto finish = [&]() { count_finish += 1; }; - - PropertyValueStore props; - props.Accept(handler, finish); - EXPECT_EQ(count_props, 0); - EXPECT_EQ(count_finish, 1); - - props.Accept(handler); - EXPECT_EQ(count_props, 0); - EXPECT_EQ(count_finish, 1); - - props.set(0, 20); - props.set(1, "bla"); - - props.Accept(handler, finish); - EXPECT_EQ(count_props, 2); - EXPECT_EQ(count_finish, 2); -} - TEST(PropertyValueStore, InsertRetrieveList) { PropertyValueStore<> props; props.set(0, std::vector{1, true, 2.5, "something",