-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 #39379, use first∘LinearIndices instead of 1 #39393
Conversation
to resolve a zero-index getindex to a linear index.
Note that this is a zero-cost abstraction: julia> @code_llvm Base._to_linear_index([])
; @ abstractarray.jl:1196 within `_to_linear_index'
define i64 @julia__to_linear_index_133({}* nonnull align 16 dereferenceable(40) %0) {
top:
ret i64 1
} |
Is it a problem that |
Ah, never mind. We do actually support |
It doesn't (see the unconditional julia> LinearIndices([])
0-element LinearIndices{1, Tuple{Base.OneTo{Int64}}}
julia> first(LinearIndices([]))
1 |
@nanosoldier |
Something went wrong when running your job:
Unfortunately, the logs could not be uploaded. |
I upgraded nanosoldier.jl on one of the nodes, I'll have a look at this in the morning |
I’d be surprised if we even have any benchmarks for |
I just wanted to check that there wasn't any overhead from this in normal benchmarks (things starting to fail to inline etc). |
to resolve a zero-index getindex to a linear index.
fix #39379