about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2024-01-13 17:12:15 +1100
committerZalathar <Zalathar@users.noreply.github.com>2024-01-13 17:21:54 +1100
commita655558b380bf689f806e45fc896b7e6ba739cb7 (patch)
tree39e5025db816509136b69ab3da59151b929d0d25 /library/alloc/src
parent89110dafe79621fa07d6cd7c8493dd1d0a83cfaf (diff)
Remove special-case handling of `vec.split_off(0)`
Diffstat (limited to 'library/alloc/src')
-rw-r--r--library/alloc/src/vec/mod.rs8
1 files changed, 0 insertions, 8 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs
index 8aa0c6e7ed6..9603f03d27f 100644
--- a/library/alloc/src/vec/mod.rs
+++ b/library/alloc/src/vec/mod.rs
@@ -2195,14 +2195,6 @@ impl<T, A: Allocator> Vec<T, A> {
             assert_failed(at, self.len());
         }
 
-        if at == 0 {
-            // the new vector can take over the original buffer and avoid the copy
-            return mem::replace(
-                self,
-                Vec::with_capacity_in(self.capacity(), self.allocator().clone()),
-            );
-        }
-
         let other_len = self.len - at;
         let mut other = Vec::with_capacity_in(other_len, self.allocator().clone());