Remove special-case handling of vec.split_off(0)
This commit is contained in:
parent
89110dafe7
commit
a655558b38
2 changed files with 18 additions and 14 deletions
|
@ -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());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue