-
Notifications
You must be signed in to change notification settings - Fork 9
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
Replace linked list with VecDeque #14
Conversation
Thank you for the PR! :) I actually started writing this project with |
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.
Looks pretty good, but there are a few things that can be further simplified before we can merge this. I would also keep the pop_*
methods unsafe.
Indeed, using As for |
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.
Thanks for the fixes! Ofc, the pop methods don't need to be unsafe.
Hey :)
I was looking around out of curiosity and found a nice place to reduce the amount of unsafety. This PR replaces Linked List-y structure of
JobQueue
with Rust's ownVecDeque
. As far as I can tell, there is no difference in performance (~1% difference on my machine). Also:VecDeque
.pop_back
andpop_front
are safe.