Skip to content

Commit d21444a

Browse files
committed
fix order
1 parent 7ae6653 commit d21444a

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/broadcast.jl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ end
207207
is_row_major(x) = is_column_major(reverse(x))
208208
_find_arg_least_greater(r::Vector{Int}, i) =
209209
findmin(x -> x > i ? x : typemax(Int), r)
210-
# @inline _bytestrides(s,paren) = VectorizationBase.bytestrides(paren)
210+
211211
function _strides_expr(
212212
@nospecialize(s),
213213
@nospecialize(x),
@@ -217,6 +217,7 @@ function _strides_expr(
217217
N = length(R)
218218
q = Expr(:block, Expr(:meta, :inline))
219219
strd_tup = Expr(:tuple)
220+
resize!(strd_tup.args, N)
220221
ifel = GlobalRef(Core, :ifelse)
221222
Nrange = 1:N # type stability w/ respect to reverse
222223
# Nrange = 1:1:N # type stability w/ respect to reverse
@@ -237,22 +238,20 @@ function _strides_expr(
237238
if sₙ_static
238239
sₙ_value = s_type.parameters[1]
239240
if s_type === One
240-
push!(strd_tup.args, Expr(:call, lv(:Zero)))
241+
strd_tup.args[n] = Expr(:call, lv(:Zero))
241242
elseif stride_acc 0
242-
push!(strd_tup.args, staticexpr(stride_acc))
243+
strd_tup.args[n] = staticexpr(stride_acc)
243244
else
244-
push!(strd_tup.args, :($getfield(x, $n)))
245+
strd_tup.args[n] = :($getfield(x, $n))
245246
end
246247
else
247248
if xₙ_static
248-
push!(strd_tup.args, staticexpr(xₙ_value))
249+
strd_tup.args[n] = staticexpr(xₙ_value)
249250
elseif stride_acc 0
250-
push!(strd_tup.args, staticexpr(stride_acc))
251+
strd_tup.args[n] = staticexpr(stride_acc)
251252
else
252-
push!(
253-
strd_tup.args,
253+
strd_tup.args[n] =
254254
:($ifel(isone($getfield(s, $n)), zero($xₙ_type), $getfield(x, $n)))
255-
)
256255
end
257256
end
258257
if (_n N)

0 commit comments

Comments
 (0)