From 4af1bf988f0830633b92bd2a6eb09358e5271a5c Mon Sep 17 00:00:00 2001 From: Ved Mahajan Date: Wed, 17 Mar 2021 18:46:42 +0530 Subject: [PATCH] changed the loop limits --- src/immutable_vector.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/immutable_vector.jl b/src/immutable_vector.jl index ddd566b..f9c3a14 100644 --- a/src/immutable_vector.jl +++ b/src/immutable_vector.jl @@ -90,11 +90,10 @@ returns a suitable `VectorFold`, which when unfolded gives the Vector V. """ function fold(v::V, depth = 0) where {T <: Real, V <: AbstractVector{T}} l = length(v) - for i in (l ÷ 2):-1:1 + for i in 1:(l ÷ 2) gap = v[i + 1] - v[1] fold, r = divrem(l, i) if r == 0 && check_pattern(v, i, gap, fold) - # return VectorFold(fold(v[1:i], depth + 1), gap, fold) return VectorFold(v[1:i], gap, fold) end