-
Notifications
You must be signed in to change notification settings - Fork 247
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
empty!() for CircularDeque, add it to docs, add some other missing things to docs #317
Conversation
…c_buffer.rst and missing priority-queue.rst to index.rst
Codecov Report
@@ Coverage Diff @@
## master #317 +/- ##
===========================================
- Coverage 96.36% 67.18% -29.19%
===========================================
Files 31 31
Lines 2284 3279 +995
===========================================
+ Hits 2201 2203 +2
- Misses 83 1076 +993
Continue to review full report at Codecov.
|
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 contribution! A couple of minor comments below.
src/circular_buffer.jl
Outdated
function Base.empty!(cb::CircularBuffer) | ||
cb.buffer = typeof(cb.buffer)[] | ||
cb | ||
end |
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.
I think you also need to reset cb.first = 1
. Is there a reason you didn't just call empty!(cb.buffer)
?
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.
Also, could you add a quick test for this?
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.
Changes make. Test added. Your suggestion is much faster. Thanks for the help!
Coverage reduction is a problem in Coverage.jl: JuliaCI/Coverage.jl#132 LGTM! Thanks for the contribution. |
No description provided.