Revert "Slightly refactor VecDeque implementation"
This reverts commit 6ce76acae4
.
This commit is contained in:
parent
90b9469121
commit
70ae43fee7
1 changed files with 3 additions and 3 deletions
|
@ -1024,7 +1024,7 @@ impl<T> VecDeque<T> {
|
||||||
iter: Iter {
|
iter: Iter {
|
||||||
tail: drain_tail,
|
tail: drain_tail,
|
||||||
head: drain_head,
|
head: drain_head,
|
||||||
ring: unsafe { self.buffer_as_slice() },
|
ring: unsafe { self.buffer_as_mut_slice() },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2593,8 +2593,8 @@ impl<T> From<VecDeque<T>> for Vec<T> {
|
||||||
let mut right_offset = 0;
|
let mut right_offset = 0;
|
||||||
for i in left_edge..right_edge {
|
for i in left_edge..right_edge {
|
||||||
right_offset = (i - left_edge) % (cap - right_edge);
|
right_offset = (i - left_edge) % (cap - right_edge);
|
||||||
let src = right_edge + right_offset;
|
let src: isize = (right_edge + right_offset) as isize;
|
||||||
ptr::swap(buf.add(i), buf.add(src));
|
ptr::swap(buf.add(i), buf.offset(src));
|
||||||
}
|
}
|
||||||
let n_ops = right_edge - left_edge;
|
let n_ops = right_edge - left_edge;
|
||||||
left_edge += n_ops;
|
left_edge += n_ops;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue