Skip to content

Commit 0f3af04

Browse files
authored
correctly set min and max in bulk_load_from_existing (#25)
1 parent f4365a7 commit 0f3af04

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/alex_nodes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,6 +1284,7 @@ class AlexDataNode : public AlexNode<T, P> {
12841284
int last_position = -1;
12851285
int keys_remaining = num_keys_;
12861286
const_iterator_type it(node, left);
1287+
min_key_ = it.key();
12871288
for (; it.cur_idx_ < right && !it.is_end(); it++) {
12881289
int position = this->model_.predict(it.key());
12891290
position = std::max<int>(position, last_position + 1);
@@ -1329,8 +1330,7 @@ class AlexDataNode : public AlexNode<T, P> {
13291330
ALEX_DATA_NODE_KEY_AT(i) = kEndSentinel_;
13301331
}
13311332

1332-
min_key_ = node->min_key_;
1333-
max_key_ = node->max_key_;
1333+
max_key_ = ALEX_DATA_NODE_KEY_AT(last_position);
13341334

13351335
expansion_threshold_ =
13361336
std::min(std::max(data_capacity_ * kMaxDensity_,

0 commit comments

Comments
 (0)