From 41ef815f62a65f87bd2cba330ca8fcac4113b14c Mon Sep 17 00:00:00 2001 From: Miles Date: Mon, 13 May 2024 19:03:56 +0200 Subject: [PATCH] Improve readability --- NDTensors/src/lib/SparseArrayDOKs/src/sparsearraydok.jl | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/NDTensors/src/lib/SparseArrayDOKs/src/sparsearraydok.jl b/NDTensors/src/lib/SparseArrayDOKs/src/sparsearraydok.jl index 0d6854e188..5bc706a9dc 100644 --- a/NDTensors/src/lib/SparseArrayDOKs/src/sparsearraydok.jl +++ b/NDTensors/src/lib/SparseArrayDOKs/src/sparsearraydok.jl @@ -121,14 +121,11 @@ end macro maybe_grow(ex) if !(ex.head == :(=) && ex.args[1] isa Expr && ex.args[1].head == :(ref)) error( - "@maybe_grow must be used with setindex! syntax (e.g. as @maybe_grow a[i,j,...] = value)", + "@maybe_grow must be used with setindex! syntax (as @maybe_grow a[i,j,...] = value)" ) end arr_name = esc(ex.args[1].args[1]) - index = esc(ex.args[1].args[2:end]) + indices = esc(ex.args[1].args[2:end]) value = esc(ex.args[2]) - e = quote - setindex_maybe_grow!($arr_name, $value, $index...) - end - return e + return :(setindex_maybe_grow!($arr_name, $value, $indices...)) end