struct maple_big_node *b_node,
unsigned char *mid_split)
{
- int split = b_node->b_end / 2; // Assume equal split.
+ unsigned char b_end = b_node->b_end;
+ int split = b_end / 2; // Assume equal split.
unsigned char min, slot_count = mt_slots[b_node->type];
if (unlikely((mas->mas_flags & MA_STATE_BULK))) {
if (ma_is_leaf(b_node->type))
min = 2;
else
- return b_node->b_end - mt_min_slots[b_node->type];
+ return b_end - mt_min_slots[b_node->type];
- split = b_node->b_end - min;
+ split = b_end - min;
mas->mas_flags |= MA_STATE_REBALANCE;
if (!b_node->slot[split])
split--;
}
if (unlikely(mab_middle_node(b_node, split, slot_count))) {
- split = b_node->b_end / 3;
+ split = b_end / 3;
*mid_split = split * 2;
} else {
min = mt_min_slots[b_node->type];
* NOTE: mt_min_slots is 1 based, b_end and split are zero.
*/
while (((b_node->pivot[split] - b_node->min) < slot_count - 1) &&
- (split < slot_count - 1) &&
- (b_node->b_end - split > min))
+ (split < slot_count - 1) && (b_end - split > min))
split++;
}