diff options
| author | C Jones <code@calebjones.net> | 2018-05-08 13:28:49 -0400 |
|---|---|---|
| committer | C Jones <code@calebjones.net> | 2018-05-08 13:28:49 -0400 |
| commit | e83c18f91d373592ecf7a0fbbc24d7597925af13 (patch) | |
| tree | d4a94d73d368dd7baadcc05b43fe9313cb92d43d /src/liballoc/btree/node.rs | |
| parent | f3a3599e090cb6aa63a327351738d7633c934728 (diff) | |
| download | rust-e83c18f91d373592ecf7a0fbbc24d7597925af13.tar.gz rust-e83c18f91d373592ecf7a0fbbc24d7597925af13.zip | |
Make an ensure_root_is_owned method to reduce duplication
Also remove some unnecessary debug_assert! when creating the shared root, since the root should be stored in the rodata and thus be impossible to accidentally modify.
Diffstat (limited to 'src/liballoc/btree/node.rs')
| -rw-r--r-- | src/liballoc/btree/node.rs | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/src/liballoc/btree/node.rs b/src/liballoc/btree/node.rs index 17eee65178e..431695c32ab 100644 --- a/src/liballoc/btree/node.rs +++ b/src/liballoc/btree/node.rs @@ -195,10 +195,6 @@ impl<K, V> Root<K, V> { } pub fn shared_empty_root() -> Self { - // Ensuring that the shared node hasn't been corrupted by any mutations - debug_assert!(EMPTY_ROOT_NODE.parent == ptr::null()); - debug_assert!(EMPTY_ROOT_NODE.parent_idx == 0); - debug_assert!(EMPTY_ROOT_NODE.len == 0); Root { node: unsafe { BoxedNode::from_ptr(NonNull::new_unchecked( |
