Skip to content

Commit ef72d49

Browse files
use eachindex instead of 1:length
Co-authored-by: Frames White <oxinabox@ucc.asn.au>
1 parent 3b29953 commit ef72d49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rulesets/SparseArrays/sparsematrix.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,6 @@ end
164164

165165
function _diagm_back(p, ȳ)
166166
k, v = p
167-
d = diag(unthunk(ȳ), k)[1:length(v)] # handle if diagonal was smaller than matrix
167+
d = diag(unthunk(ȳ), k)[eachindex(v)] # handle if diagonal was smaller than matrix
168168
return Tangent{typeof(p)}(second = d)
169169
end

0 commit comments

Comments
 (0)