diff --git a/lib/pure/collections/sequtils.nim b/lib/pure/collections/sequtils.nim index 63d910a8edc4e..2e21786bbd169 100644 --- a/lib/pure/collections/sequtils.nim +++ b/lib/pure/collections/sequtils.nim @@ -709,7 +709,7 @@ template applyIt*(varSeq, op: untyped) = ## var nums = @[1, 2, 3, 4] ## nums.applyIt(it * 3) ## assert nums[0] + nums[3] == 15 - for i in 0 ..< varSeq.len: + for i in low(varSeq) .. high(varSeq): let it {.inject.} = varSeq[i] varSeq[i] = op