Fix sharing map internal assertion

This commit is contained in:
Daniel Poetzl 2018-07-02 14:52:05 +01:00
parent 332febe884
commit 4438b436c4
1 changed files with 3 additions and 2 deletions

View File

@ -257,8 +257,9 @@ public:
leaft *place_leaf(const keyT &k, const valueT &v)
{
SN_ASSERT(is_container());
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
SN_ASSERT(empty() || as_const(this)->find_leaf(k) == nullptr);
leaf_listt &c = get_container();
c.push_front(leaft(k, v));