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

Fix offset LinearIndices range indexing (fixes #27986) #28001

Merged
merged 1 commit into from
Jul 10, 2018

Conversation

timholy
Copy link
Member

@timholy timholy commented Jul 9, 2018

CC @andyferris

Fixes #27986.

Copy link
Member

@mbauman mbauman 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 fix!

base/indices.jl Outdated
@@ -364,14 +364,14 @@ IndexStyle(::Type{<:LinearIndices}) = IndexLinear()
axes(iter::LinearIndices) = map(indices1, iter.indices)
size(iter::LinearIndices) = map(unsafe_length, iter.indices)
function getindex(iter::LinearIndices, i::Int)
@_inline_meta
@_propagate_inbounds_meta
Copy link
Member

Choose a reason for hiding this comment

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

Propagate inbounds should only be needed if this function itself calls getindex — I think @inline should be correct here. Did you see this make a difference?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, you're right, I am rusty on that machinery. Will correct. Thanks for looking!

@timholy timholy force-pushed the teh/sliceindexing branch from 99b9e56 to d5392ac Compare July 9, 2018 17:37
@timholy timholy merged commit 092b6c9 into master Jul 10, 2018
@timholy timholy deleted the teh/sliceindexing branch July 10, 2018 08:20
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.

3 participants