[btree] lower bound search should return an empty optional if every entry in the node is higher.
Patch from Ming-Hung Tsai
This commit is contained in:
parent
880785a9bf
commit
cf903cfea6
@ -458,7 +458,8 @@ namespace persistent_data {
|
|||||||
template <typename ValueTraits>
|
template <typename ValueTraits>
|
||||||
struct lower_bound_search {
|
struct lower_bound_search {
|
||||||
static boost::optional<unsigned> search(btree_detail::node_ref<ValueTraits> n, uint64_t key) {
|
static boost::optional<unsigned> search(btree_detail::node_ref<ValueTraits> n, uint64_t key) {
|
||||||
return n.lower_bound(key);
|
int i = n.lower_bound(key);
|
||||||
|
return (i < 0) ? boost::optional<unsigned>() : boost::optional<unsigned>(i);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user