PropertyValueStore - remove Accept function (never used, never will be)

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D781
This commit is contained in:
florijan 2017-09-12 14:41:18 +02:00
parent 00723d34c3
commit 36fb7f9554
3 changed files with 0 additions and 49 deletions

View File

@ -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<void(const TKey, const PropertyValue &)> handler,
std::function<void()> finish = {}) const {
if (handler)
for (const auto &prop : props_) handler(prop.first, prop.second);
if (finish) finish();
}
private:
std::vector<std::pair<TKey, PropertyValue>> props_;
};

View File

@ -33,15 +33,6 @@ const PropertyValueStore<GraphDbTypes::Property>
return current().properties_;
}
template <typename TRecord>
void RecordAccessor<TRecord>::PropertiesAccept(
std::function<void(const GraphDbTypes::Property key,
const PropertyValue &prop)>
handler,
std::function<void()> finish) const {
current().properties_.Accept(handler, finish);
}
template <typename TRecord>
GraphDbAccessor &RecordAccessor<TRecord>::db_accessor() const {
return *db_accessor_;

View File

@ -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<uint32_t> 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<PropertyValue>{1, true, 2.5, "something",