Skip to content

Commit 40fef9c

Browse files
committed
Don't accidentally overwrite first
1 parent 5107c18 commit 40fef9c

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

src/constructors.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
# end
1212

1313
function Base.copyto!(ls::LoopSet, q::Expr)
14-
q.head === :for || throw("Expression must be a for loop.")
15-
add_loop!(ls, q, 8)
14+
q.head === :for || throw("Expression must be a for loop.")
15+
add_loop!(ls, q, 8)
1616
# strip_unneeded_const_deps!(ls)
1717
end
1818

@@ -61,11 +61,11 @@ end
6161

6262

6363
function LoopSet(q::Expr, mod::Symbol = :Main)
64-
contract_pass!(q)
65-
ls = LoopSet(mod)
66-
copyto!(ls, q)
67-
resize!(ls.loop_order, num_loops(ls))
68-
ls
64+
contract_pass!(q)
65+
ls = LoopSet(mod)
66+
copyto!(ls, q)
67+
resize!(ls.loop_order, num_loops(ls))
68+
ls
6969
end
7070
LoopSet(q::Expr, m::Module) = LoopSet(macroexpand(m, q)::Expr, Symbol(m))
7171

src/getconstindexes.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
for (i,f) enumerate((:first,:second,:third,:fourth,:fifth,:sixth,:seventh,:eighth,:ninth,:tenth,:eleventh,:twelfth,:thirteenth))
1+
for (i,f) enumerate((:second,:third,:fourth,:fifth,:sixth,:seventh,:eighth,:ninth,:tenth,:eleventh,:twelfth,:thirteenth))
22
@eval @inline $f(x) = @inbounds getindex(x, $(i+1))
33
end
44

src/modeling/graphs.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -741,11 +741,11 @@ function pushop!(ls::LoopSet, op::Operation, var::Symbol = name(op))
741741
op
742742
end
743743
function add_block!(ls::LoopSet, ex::Expr, elementbytes::Int, position::Int)
744-
for x ex.args
745-
x isa Expr || continue # be that general?
746-
x.head === :inbounds && continue
747-
push!(ls, x, elementbytes, position)
748-
end
744+
for x ex.args
745+
x isa Expr || continue # be that general?
746+
x.head === :inbounds && continue
747+
push!(ls, x, elementbytes, position)
748+
end
749749
end
750750
function maybestatic!(expr::Expr)
751751
if expr.head === :call
@@ -947,7 +947,7 @@ function add_loop!(ls::LoopSet, q::Expr, elementbytes::Int)
947947
body = q.args[2]::Expr
948948
position = length(ls.loopsymbols)
949949
if body.head === :block
950-
add_block!(ls, body, elementbytes, position)
950+
add_block!(ls, body, elementbytes, position)
951951
else
952952
push!(ls, q, elementbytes, position)
953953
end

src/parse/add_compute.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ function add_compute!(
252252
mpref::Union{Nothing,ArrayReferenceMetaPosition} = nothing
253253
)
254254
@assert ex.head === :call
255-
# instr = instruction(first(ex.args))::Symbol
255+
# instr = instruction(first(ex.args))::Symbol
256256
instr = instruction!(ls, first(ex.args))::Instruction
257257
args = @view(ex.args[2:end])
258258
if (instr.instr === :pow_fast || instr.instr === :(^)) && length(args) == 2

0 commit comments

Comments
 (0)