Skip to content

Commit

Permalink
Fix bug in IFiter
Browse files Browse the repository at this point in the history
  • Loading branch information
bamless committed Feb 16, 2021
1 parent 834988b commit 5f35012
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Binary file modified src/std/core.jsc
Binary file not shown.
7 changes: 5 additions & 2 deletions src/std/core.jsr
Expand Up @@ -368,19 +368,22 @@ class IFilter is Iterable
fun new(predicate, iterable)
this._predicate = predicate
this._iterable = iterable
this._next = null
end

fun __iter__(iter)
while iter = this._iterable.__iter__(iter) do
if this._predicate(this._iterable.__next__(iter)) then
var next = this._iterable.__next__(iter)
if this._predicate(next) then
this._next = next
return iter
end
end
return false
end

fun __next__(i)
return this._iterable.__next__(i)
return this._next
end
end

Expand Down

0 comments on commit 5f35012

Please sign in to comment.