File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -419,9 +419,10 @@ class b_plus_tree_multimap {
419419 if (data_.empty ()) {
420420 // Nothing to merge, just remove node. This should be rare, i.e. only happens when
421421 // a rare 1-entry node has its last entry removed.
422+ auto next_node = next_node_; // create copy because (this) will be deleted
422423 remove_from_siblings ();
423424 parent_->remove_node (max_key_old, this , tree);
424- return next_node_ == nullptr ? ER{} : ER{next_node_, next_node_ ->data_ .begin ()};
425+ return next_node == nullptr ? ER{} : ER{next_node, next_node ->data_ .begin ()};
425426 }
426427
427428 if (data_.size () < this ->M_min ()) {
@@ -500,9 +501,10 @@ class b_plus_tree_multimap {
500501 if (data_.empty ()) {
501502 // Nothing to merge, just remove node. This should be rare, i.e. only happens when
502503 // a rare 1-entry node has its last entry removed.
504+ auto next_node = next_node_; // create copy because (this) will be deleted
503505 remove_from_siblings ();
504506 parent_->remove_node (max_key_old, this , tree);
505- return next_node_ == nullptr ? ER{} : ER{next_node_, next_node_ ->data_ .begin ()};
507+ return next_node == nullptr ? ER{} : ER{next_node, next_node ->data_ .begin ()};
506508 }
507509
508510 if (data_.size () < this ->M_min ()) {
You can’t perform that action at this time.
0 commit comments