rust/src/liballoc/tests
Dylan DPC 718ba0d23b
Rollup merge of #68770 - ssomers:btree_drain_filter, r=Amanieu
BTreeMap/BTreeSet: implement drain_filter

Provide an implementation of drain_filter for BTreeMap and BTreeSet. Should be optimal when the predicate picks only elements in leaf nodes with at least MIN_LEN remaining elements, which is a common case, at least when draining only a fraction of the map/set, and also when the predicate picks elements stored in internal nodes where the right subtree can easily let go of a replacement element.

The first commit adds benchmarks with an external, naive implementation. to compare how much this claimed optimality-in-some-cases is actually worth.
2020-04-01 00:27:18 +02:00
..
btree Rollup merge of #68770 - ssomers:btree_drain_filter, r=Amanieu 2020-04-01 00:27:18 +02:00
arc.rs Use drop instead of the toilet closure |_| () 2020-01-02 08:56:12 +00:00
binary_heap.rs Fix binary_heap::DrainSorted drop leak on panics 2020-01-19 20:23:07 +01:00
boxed.rs Format liballoc with rustfmt 2019-11-29 20:25:07 -08:00
cow_str.rs Small Cow improvements 2019-12-11 21:01:33 +01:00
fmt.rs Remove licenses 2018-12-25 21:08:33 -07:00
heap.rs Remove usable_size APIs 2020-03-03 00:08:24 +01:00
lib.rs BTreeMap/BTreeSet: implement and test drain_filter 2020-03-29 16:05:53 +02:00
linked_list.rs Format 2020-01-19 20:50:00 +01:00
rc.rs Use drop instead of the toilet closure |_| () 2020-01-02 08:56:12 +00:00
slice.rs reduce test size for Miri 2020-03-05 23:41:17 +01:00
str.rs Don't return empty slice on last iteration with matched terminator. Test reverse iteration. 2020-02-09 23:49:44 +09:00
string.rs must_use on split_off 2020-03-24 17:35:40 +00:00
vec.rs Format 2020-01-19 20:50:00 +01:00
vec_deque.rs Format 2020-01-19 20:50:00 +01:00