Skip to content

Commit 42bd690

Browse files
committed
Use emplace() in sharing_nodet
1 parent 3f012df commit 42bd690

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/util/sharing_node.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,8 @@ SN_TYPE_PAR_DEF class sharing_nodet
296296
PRECONDITION(empty() || as_const(this)->find_leaf(k) == nullptr);
297297

298298
leaf_listt &c = get_container();
299-
c.push_front(leaft(k, std::forward<valueU>(v)));
299+
c.emplace_front(k, std::forward<valueU>(v));
300+
SN_ASSERT(c.front().is_defined_leaf());
300301

301302
return &c.front();
302303
}

0 commit comments

Comments
 (0)