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

Replace a few uses of 1:length idiom with eachindex #4210

Merged
merged 1 commit into from
May 31, 2022

Conversation

brenhinkeller
Copy link
Contributor

Not exhaustive, but I think this catches the only places this idiom was used together with @inbounds. Should be a simple swap out.

@isentropic
Copy link
Member

Let's merge one the tests pass

@codecov
Copy link

codecov bot commented May 21, 2022

Codecov Report

Merging #4210 (4f6cd0a) into master (de96717) will increase coverage by 0.03%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #4210      +/-   ##
==========================================
+ Coverage   77.88%   77.91%   +0.03%     
==========================================
  Files          28       28              
  Lines        7081     7083       +2     
==========================================
+ Hits         5515     5519       +4     
+ Misses       1566     1564       -2     
Impacted Files Coverage Δ
src/utils.jl 62.22% <0.00%> (ø)
src/recipes.jl 64.57% <0.00%> (+0.29%) ⬆️

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 de96717...4f6cd0a. Read the comment docs.

@mkborregaard
Copy link
Member

Weird - these must have been added after #2304 ? Implementing the general array interface back then was a lot of effort

@brenhinkeller
Copy link
Contributor Author

Huh. Oh I'll bet.. There were a few others that popped up as well when searching https://pkg.juliahub.com/ui/Search?type=code&q=1%3Alength&r=true&p=Plots%3A91a5bcdd-55d7-5caf-9e0b-520d859cae80
but not with @inbounds and many not in for loops so I was less sure what the best replacement would be; some of those may actually be OK.

@isentropic
Copy link
Member

Perhaps you could also capture the rest and we merge it in altogether?

@brenhinkeller
Copy link
Contributor Author

Sure!

@brenhinkeller
Copy link
Contributor Author

Hmm, it didn't like that at all... Switching back to just the two easy ones for now

@isentropic
Copy link
Member

That's a little strange, not sure why such things could happen

@brenhinkeller
Copy link
Contributor Author

Yeah, not sure.. they seemed innocuous enough but I guess it's the first time I've spent any time with this codebase. Looks better now I guess though!

@BeastyBlacksmith
Copy link
Member

Thanks for diggin in and since this is your first contribution, you might want to take a look at #3503 .

@brenhinkeller
Copy link
Contributor Author

Oh cool! Thanks!

@BeastyBlacksmith BeastyBlacksmith merged commit 5a6e8fb into JuliaPlots:master May 31, 2022
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.

4 participants