Skip to content

Commit

Permalink
Fix Cycler iterator return Value (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota authored Jul 8, 2021
1 parent 0a545e7 commit 047652e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/function/cycler.cr
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class Crinja::Function::Cycler

@[Crinja::Attribute]
def current
return "" if @index < 0 # .current called directly after initialization or rewind
@values[@index].raw
return Value::UNDEFINED if @index < 0 # .current called directly after initialization or rewind
@values[@index]
end

@[Crinja::Attribute]
def next
def next : Crinja::Value | ::Iterator::Stop
@index += 1
@index %= @values.size
current
Expand Down

0 comments on commit 047652e

Please sign in to comment.