Skip to content

Commit

Permalink
Slightly refactor VecDeque implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
MaloJaffre committed Aug 24, 2018
1 parent 57e13ba commit 6ce76ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/liballoc/collections/vec_deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ impl<T> VecDeque<T> {
iter: Iter {
tail: drain_tail,
head: drain_head,
ring: unsafe { self.buffer_as_mut_slice() },
ring: unsafe { self.buffer_as_slice() },
},
}
}
Expand Down Expand Up @@ -2593,8 +2593,8 @@ impl<T> From<VecDeque<T>> for Vec<T> {
let mut right_offset = 0;
for i in left_edge..right_edge {
right_offset = (i - left_edge) % (cap - right_edge);
let src: isize = (right_edge + right_offset) as isize;
ptr::swap(buf.add(i), buf.offset(src));
let src = right_edge + right_offset;
ptr::swap(buf.add(i), buf.add(src));
}
let n_ops = right_edge - left_edge;
left_edge += n_ops;
Expand Down

0 comments on commit 6ce76ac

Please sign in to comment.