X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2Fweighted_btree.h;h=86063c3ae98355ac73fa33fc7149ef6a84eb95fb;hb=7b0f9d95248820bc70b820dd6b558de4a6713bae;hp=b64f95366f6e5cb2f398560b0ffe7156eaf0237c;hpb=2f572f7a289063e8203a4947a1e6adba8d7c6ad8;p=lyx.git diff --git a/src/support/weighted_btree.h b/src/support/weighted_btree.h index b64f95366f..86063c3ae9 100644 --- a/src/support/weighted_btree.h +++ b/src/support/weighted_btree.h @@ -151,7 +151,7 @@ public: /// typedef _Weight weight_type; - + /// Second template parameter: The data type associated with each /// key. Stored in the B+ tree's leaves typedef _Data data_type; @@ -1519,13 +1519,13 @@ public: return iterator(leaf, slot); } - /// Searches the B+ tree and returns an iterator to the first summed weight + /// Searches the B+ tree and returns an iterator to the first summed weight /// less or equal to the parameter. If unsuccessful it returns end(). iterator lower_summed_weight_bound(weight_type weight) { node *n = root; if (!n) return end(); - + while(!n->isleafnode()) { const inner_node *inner = static_cast(n); int slot = find_summed_weight_lower(inner, weight); @@ -1567,7 +1567,7 @@ public: return const_iterator(leaf, slot); } - /// Searches the B+ tree and returns an iterator to the first summed weight + /// Searches the B+ tree and returns an iterator to the first summed weight /// less or equal to the parameter. If unsuccessful it returns end(). const_iterator lower_summed_weight_bound(weight_type weight) const { @@ -1637,7 +1637,7 @@ public: return const_iterator(leaf, slot); } - /// Searches the B+ tree and returns an iterator to the first summed weight + /// Searches the B+ tree and returns an iterator to the first summed weight /// greater than the parameter. If unsuccessful it returns end(). iterator upper_summed_weight_bound(weight_type weight) { @@ -1665,7 +1665,7 @@ public: return iterator(leaf, slot); } - /// Searches the B+ tree and returns an iterator to the first summed weight + /// Searches the B+ tree and returns an iterator to the first summed weight /// greater than the parameter. If unsuccessful it returns end(). const_iterator upper_summed_weight_bound(weight_type weight) const { @@ -1769,7 +1769,7 @@ public: clear(); key_less = other.key_comp(); - if (other.size() != 0) + if (!other.empty()) { stats.leaves = stats.innernodes = 0; root = copy_recursive(other.root); @@ -1788,7 +1788,7 @@ public: stats( other.stats ), key_less( other.key_comp() ) { - if (size() > 0) + if (!empty()) { stats.leaves = stats.innernodes = 0; root = copy_recursive(other.root); @@ -2023,7 +2023,7 @@ private: slot -= inner->slotuse+1; inner = static_cast(*splitnode); - BTREE_PRINT("btree::insert_descend switching to splitted node " << inner << " slot " << slot <