Merge pull request #303 from bdutro/patch-1-squashed

Fix compiler error by updating node_data::remove to use new equals() method.
This commit is contained in:
Jesse Beder
2015-04-08 13:59:56 -05:00
2 changed files with 8 additions and 1 deletions

View File

@@ -133,7 +133,7 @@ inline bool node_data::remove(const Key& key, shared_memory_holder pMemory) {
return false; return false;
for (node_map::iterator it = m_map.begin(); it != m_map.end(); ++it) { for (node_map::iterator it = m_map.begin(); it != m_map.end(); ++it) {
if (equals(*it->first, key, pMemory)) { if (it->first->equals(key, pMemory)) {
m_map.erase(it); m_map.erase(it);
return true; return true;
} }

View File

@@ -39,6 +39,13 @@ TEST(NodeTest, SimpleAppendSequence) {
EXPECT_TRUE(node.IsSequence()); EXPECT_TRUE(node.IsSequence());
} }
TEST(NodeTest, MapElementRemoval) {
Node node;
node["foo"] = "bar";
node.remove("foo");
EXPECT_TRUE(!node["foo"]);
}
TEST(NodeTest, SimpleAssignSequence) { TEST(NodeTest, SimpleAssignSequence) {
Node node; Node node;
node[0] = 10; node[0] = 10;