Skip to content

Commit eef68f3

Browse files
committed
Remove cast to const from MergeMapCollection()
1 parent da04fa3 commit eef68f3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/nodebuilder.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,14 @@ void NodeBuilder::OnMapStart(const Mark& mark, const std::string& tag,
7676

7777
void MergeMapCollection(detail::node& map_to, detail::node& map_from,
7878
detail::shared_memory_holder& pMemory) {
79-
const detail::node& const_map_to = map_to;
8079
for (auto j = map_from.begin(); j != map_from.end(); j++) {
8180
const auto & from_key = j->first;
8281
/// NOTE: const_map_to.get(*j->first) cannot be used here, since it
8382
/// compares only the shared_ptr's, while we need to compare the key
8483
/// itself.
8584
///
8685
/// NOTE: get() also iterates over elements
87-
bool found = std::any_of(const_map_to.begin(), const_map_to.end(), [&](const detail::node_iterator_value<const detail::node> & kv)
86+
bool found = std::any_of(map_to.begin(), map_to.end(), [&](const detail::node_iterator_value<detail::node> & kv)
8887
{
8988
const auto & key_node = kv.first;
9089
return key_node->scalar() == from_key->scalar();

0 commit comments

Comments
 (0)