mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Auto merge of #79987 - ssomers:btree_cleanup_4, r=Mark-Simulacrum
BTreeMap: detect bulk_steal's count-1 underflow in release builds too r? `@Mark-Simulacrum`
This commit is contained in:
commit
69ff39ee32
@ -1475,6 +1475,7 @@ impl<'a, K: 'a, V: 'a> BalancingContext<'a, K, V> {
|
||||
|
||||
/// This does stealing similar to `steal_left` but steals multiple elements at once.
|
||||
pub fn bulk_steal_left(&mut self, count: usize) {
|
||||
assert!(count > 0);
|
||||
unsafe {
|
||||
let left_node = &mut self.left_child;
|
||||
let old_left_len = left_node.len();
|
||||
@ -1532,6 +1533,7 @@ impl<'a, K: 'a, V: 'a> BalancingContext<'a, K, V> {
|
||||
|
||||
/// The symmetric clone of `bulk_steal_left`.
|
||||
pub fn bulk_steal_right(&mut self, count: usize) {
|
||||
assert!(count > 0);
|
||||
unsafe {
|
||||
let left_node = &mut self.left_child;
|
||||
let old_left_len = left_node.len();
|
||||
|
Loading…
Reference in New Issue
Block a user