Commit Graph

4 Commits

Author SHA1 Message Date
Dan Gohman
06fe3b654f Avoid match expressions with reference patterns.
https://github.com/rust-lang-nursery/rust-clippy/wiki#match_ref_pats
2018-03-15 22:44:54 -07:00
Jakob Stoklund Olesen
3389eaef29 Add a clear() method to bforest::{Set,Map}.
This is a lot more efficient that removing entries one by one.
2017-11-20 14:16:19 -08:00
Jakob Stoklund Olesen
d3778e56bb Remove the "BPlus" prefix from bforest::* types.
We'll just use the bforest:: namespace for these types, avoiding the
confusing mix of prefixed and non-prefixed names.

No functional change intended.
2017-11-20 14:15:56 -08:00
Jakob Stoklund Olesen
aa6f5c0db3 Forests of B+ trees.
Add new ordered set and map data structures based on B+-trees. These are
not general-purpose data structures like the BTreeSet and BTreeMap types
in the standard library. They are specialized for:

- Keys and values are small `Copy` types, optimized for 32-bit entities.
- Each set or map has a very small footprint, using only 32 bits of
  memory when empty.
- Keys are compared using a borrowed comparator object which can provide
  context for comparing tiny types that don't contain enough information
  to implement `Ord`.
- A whole forest of B-trees can be cleared in constant time without
  having to traverse the whole data structure.
2017-11-17 07:21:19 -08:00