Skip to content

Commit

Permalink
changed the loop limits
Browse files Browse the repository at this point in the history
  • Loading branch information
Ved-Mahajan committed Mar 17, 2021
1 parent 787249c commit 4af1bf9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/immutable_vector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4af1bf9

Please sign in to comment.