5c02926546
BTree: no longer copy keys and values before dropping them When dropping BTreeMap or BTreeSet instances, keys-value pairs are up to now each copied and then dropped, at least according to source code. This is because the code for dropping and for iterators is shared. This PR postpones the treatment of doomed key-value pairs from the intermediate functions `deallocating_next`(`_back`) to the last minute, so the we can drop the keys and values in place. According to the library/alloc benchmarks, this does make a difference, (and a positive difference with an `#[inline]` on `drop_key_val`). It does not change anything for #81444 though. r? `@Mark-Simulacrum` |
||
---|---|---|
.. | ||
benches | ||
src | ||
tests | ||
Cargo.toml |