Skip to content
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

Merged
merged 5 commits into from
Aug 28, 2017

Conversation

KadeG
Copy link
Contributor

@KadeG KadeG commented Aug 18, 2017

No description provided.

@codecov
Copy link

codecov bot commented Aug 18, 2017

Codecov Report

Merging #317 into master will decrease coverage by 29.18%.
The diff coverage is 50%.

Impacted file tree graph

@@             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
Impacted Files Coverage Δ
src/circular_buffer.jl 66% <50%> (-34%) ⬇️
src/delegate.jl 50% <0%> (-50%) ⬇️
src/tokens.jl 50% <0%> (-50%) ⬇️
src/dict_support.jl 57.14% <0%> (-42.86%) ⬇️
src/accumulator.jl 58.92% <0%> (-41.08%) ⬇️
src/tokens2.jl 60.93% <0%> (-39.07%) ⬇️
src/container_loops.jl 60.27% <0%> (-38.61%) ⬇️
src/stack.jl 57.14% <0%> (-35.17%) ⬇️
src/queue.jl 59.09% <0%> (-33.77%) ⬇️
src/heaps.jl 66.66% <0%> (-33.34%) ⬇️
... and 22 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7178c60...625bcae. Read the comment docs.

Copy link
Member

@kmsquire kmsquire left a 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.

function Base.empty!(cb::CircularBuffer)
cb.buffer = typeof(cb.buffer)[]
cb
end
Copy link
Member

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)?

Copy link
Member

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?

Copy link
Contributor Author

@KadeG KadeG Aug 27, 2017

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!

@kmsquire
Copy link
Member

Coverage reduction is a problem in Coverage.jl: JuliaCI/Coverage.jl#132

LGTM! Thanks for the contribution.

@kmsquire kmsquire merged commit db195d4 into JuliaCollections:master Aug 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants