Skip to content

Commit 0c9d6b0

Browse files
committed
Split an add_store method in two, to create convenient method for use elsewhere.
1 parent 6696b14 commit 0c9d6b0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/add_stores.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,16 @@ function add_store!(
5757
mpref = array_reference_meta!(ls, array, rawindices, elementbytes)
5858
add_store!(ls, var, mpref, elementbytes)
5959
end
60-
function add_simple_store!(ls::LoopSet, var::Symbol, ref::ArrayReference, elementbytes::Int)
60+
function add_simple_store!(ls::LoopSet, parent::Operation, ref::ArrayReference, elementbytes::Int)
6161
mref = ArrayReferenceMeta(
6262
ref, fill(true, length(getindices(ref)))
6363
)
64-
parents = [getop(ls, var, elementbytes)]
65-
ldref = convert(Vector{Symbol}, getindices(ref))
66-
op = Operation( ls, name(mref), elementbytes, :setindex!, memstore, ldref, NODEPENDENCY, parents, mref )
64+
op = Operation( ls, name(mref), elementbytes, :setindex!, memstore, getindices(ref), NODEPENDENCY, [parent], mref )
6765
add_unique_store!(ls, op)
6866
end
67+
function add_simple_store!(ls::LoopSet, var::Symbol, ref::ArrayReference, elementbytes::Int)
68+
add_simple_store!(ls, getop(ls, var, elementbytes), ref, elementbytes)
69+
end
6970
function add_store_ref!(ls::LoopSet, var::Symbol, ex::Expr, elementbytes::Int)
7071
array, raw_indices = ref_from_ref(ex)
7172
add_store!(ls, var, array, raw_indices, elementbytes)

0 commit comments

Comments
 (0)