diff --git a/src/structarray.jl b/src/structarray.jl index 64ff17a..4cfacdc 100644 --- a/src/structarray.jl +++ b/src/structarray.jl @@ -338,12 +338,7 @@ to map(c -> c[I...], Tuple(cols)) ``` """ -@inline get_ith(cols::NamedTuple, I...) = get_ith(Tuple(cols), I...) -@inline function get_ith(cols::Tuple, I...) - @inbounds r = first(cols)[I...] - return (r, get_ith(Base.tail(cols), I...)...) -end -@inline get_ith(::Tuple{}, I...) = () +@inline @generated get_ith(cols::Tup, I...) = :(Base.Cartesian.@ntuple $(fieldcount(cols)) i -> @inbounds cols[i][I...]) Base.@propagate_inbounds Base.getindex(x::StructArray, I...) = _getindex(x, to_indices(x, I)...)