static inline void mss_fill_bnode(struct maple_split_state *mss,
struct ma_state *mas, unsigned char skip)
{
- bool cp = true;
+ bool cp = false;
struct maple_enode *old = mas->node;
unsigned char split;
memset(mss->bn, 0, sizeof(struct maple_big_node));
- if (mte_is_root(mas->node)) {
- cp = false;
- } else {
+ if (!mte_is_root(mas->node)) {
+ cp = true;
mas_ascend(mas);
mat_add(mss->free, old);
mas->offset = mte_parent_slot(mas->node);
+ if (mss->l->offset)
+ mas_mab_cp(mas, 0, mss->l->offset - 1, mss->bn, 0);
}
- if (cp && mss->l->offset)
- mas_mab_cp(mas, 0, mss->l->offset - 1, mss->bn, 0);
-
split = mss->bn->b_end;
mab_set_b_end(mss->bn, mss->l, mss->l->node);
mss->r->offset = mss->bn->b_end;
mab_set_b_end(mss->bn, mss->r, mss->r->node);
- if (mss->bn->pivot[mss->bn->b_end - 1] == mas->max)
- cp = false;
-
- if (cp)
+ if (cp && (mss->bn->pivot[mss->bn->b_end - 1] != mas->max))
mas_mab_cp(mas, split + skip, mt_slot_count(mas->node) - 1,
mss->bn, mss->bn->b_end);