We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 14b0392 commit 42ccf02Copy full SHA for 42ccf02
src/util/sharing_node.h
@@ -257,8 +257,9 @@ SN_TYPE_PAR_DEF class sharing_node_innert : public sharing_node_baset
257
leaft *place_leaf(const keyT &k, const valueT &v)
258
{
259
SN_ASSERT(is_container());
260
-
261
- SN_ASSERT(as_const(this)->find_leaf(k) == nullptr);
+ // we need to check empty() first as the const version of find_leaf() must
+ // not be called on an empty node
262
+ SN_ASSERT(empty() || as_const(this)->find_leaf(k) == nullptr);
263
264
leaf_listt &c = get_container();
265
c.push_front(leaft(k, v));
0 commit comments