-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Implement VecDeque::extract_if #147780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Implement VecDeque::extract_if #147780
Conversation
Signed-off-by: tison <wander4096@gmail.com>
This comment has been minimized.
This comment has been minimized.
Signed-off-by: tison <wander4096@gmail.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
f120ac2
to
6f38bda
Compare
This comment has been minimized.
This comment has been minimized.
6f38bda
to
1d182aa
Compare
This comment has been minimized.
This comment has been minimized.
1d182aa
to
238229b
Compare
This comment has been minimized.
This comment has been minimized.
Signed-off-by: tison <wander4096@gmail.com>
238229b
to
9cba3ed
Compare
This comment has been minimized.
This comment has been minimized.
Signed-off-by: tison <wander4096@gmail.com>
This is now ready for review. I'm trying to port some tests from LinkedList's extract_if cases. |
This comment has been minimized.
This comment has been minimized.
c42dc3b
to
ff878de
Compare
This comment has been minimized.
This comment has been minimized.
Signed-off-by: tison <wander4096@gmail.com>
ff878de
to
2915a63
Compare
// We use copy for move, and never touch this element again. | ||
unsafe { | ||
let hole_slot = self.vec.ptr().add(idx - self.del); | ||
ptr::copy_nonoverlapping(cur, hole_slot, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this instead be wrap_copy
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes correct. Try fix in a7d0a43.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI looks happy. I'm not sure how to ensure the manner, i.e., constructing a VecDeque that wrap the underlying vec.
Signed-off-by: tison <wander4096@gmail.com>
This refers to #147750.