Skip to content

Commit

Permalink
Added commented out code which has a small perf improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
josephg committed Mar 28, 2024
1 parent e534da8 commit d6be6cb
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/ost/index_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,19 @@ impl<V: Default + IndexContent> IndexTree<V> {
let leaf = &self[cursor.leaf_idx];
// TODO: Consider caching the upper bound of the subsequent element in the cursor.

// This is correct, but doesn't improve performance.
// if lv >= leaf.bounds[cursor.elem_idx] {
// let next_elem = cursor.elem_idx + 1;
// let upper_bound = if next_elem >= LEAF_CHILDREN || leaf.bounds[next_elem] == usize::MAX {
// self.leaf_upper_bound(leaf)
// } else {
// leaf.bounds[next_elem]
// };
// if lv < upper_bound {
// return cursor;
// }
// }

if lv >= leaf.bounds[0] {
// There are 3 cases:
// - The lv is less than the bound (or this is the last node)
Expand Down

0 comments on commit d6be6cb

Please sign in to comment.