KT
Size: a a a
KT
KT
KT
VG
АО
KT
KT
АО
АО
KT
АО
KT
KT
АО
KT
VG
АО
function dropxx(t::NTuple, k)
ntuple(i -> i < k ? t[i] : t[i + 1], length(t) - 1)
end
dropxx((10, 20, 30, 40), 3)
# (10, 20, 40)
@code_typed dropxx((10, 20, 30, 40), 3)
CodeInfo(
1 ── %1 = Base.slt_int(1, k)::Bool
└─── goto #3 if not %1
2 ── %3 = Base.getfield(t, 1, true)::Int64
└─── goto #4
3 ── %5 = Base.getfield(t, 2, true)::Int64
└─── goto #4
4 ┄─ %7 = φ (#2 => %3, #3 => %5)::Int64
│ %8 = Base.slt_int(2, k)::Bool
└─── goto #6 if not %8
5 ── %10 = Base.getfield(t, 2, true)::Int64
└─── goto #7
6 ── %12 = Base.getfield(t, 3, true)::Int64
└─── goto #7
7 ┄─ %14 = φ (#5 => %10, #6 => %12)::Int64
│ %15 = Base.slt_int(3, k)::Bool
└─── goto #9 if not %15
8 ── %17 = Base.getfield(t, 3, true)::Int64
└─── goto #10
9 ── %19 = Base.getfield(t, 4, true)::Int64
└─── goto #10
10 ┄ %21 = φ (#8 => %17, #9 => %19)::Int64
│ %22 = Core.tuple(%7, %14, %21)::Tuple{Int64,Int64,Int64}
└─── goto #11
11 ─ return %22
) => Tuple{Int64,Int64,Int64}
АО
KT