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

specialize reverse for AbstractFill #201

Merged
merged 6 commits into from
Dec 8, 2022
Merged

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Dec 7, 2022

On master

julia> reverse(Ones(3))
3-element Vector{Float64}:
 1.0
 1.0
 1.0

After this PR

julia> reverse(Ones(3))
3-element Ones{Float64}

@codecov
Copy link

codecov bot commented Dec 7, 2022

Codecov Report

Merging #201 (982011b) into master (0f12596) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #201      +/-   ##
==========================================
+ Coverage   97.87%   97.89%   +0.01%     
==========================================
  Files           4        4              
  Lines         660      665       +5     
==========================================
+ Hits          646      651       +5     
  Misses         14       14              
Impacted Files Coverage Δ
src/FillArrays.jl 97.36% <ø> (ø)
src/fillalgebra.jl 98.95% <100.00%> (+0.02%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -26,6 +26,13 @@ function permutedims(B::AbstractFill, perm)
fillsimilar(B, dimsP)
end

function reverse(A::AbstractFill, start::Integer=firstindex(A), stop::Integer=lastindex(A))
checkbounds(A, start)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use @propagate_inbounds and @boundscheck ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good idea

@dlfivefifty
Copy link
Member

Tests turn off bounds checking

@jishnub
Copy link
Member Author

jishnub commented Dec 8, 2022

Should be good now

@dlfivefifty dlfivefifty merged commit 4845062 into JuliaArrays:master Dec 8, 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.

2 participants