Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/fusion/iterutils.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import sugar

iterator findAll*[T](s : openArray[T], val : T) : int =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the new iterable from devel

for i, x in s:
if x == val:
yield i

iterator findAll*[T](s : openArray[T], pred : (T) -> bool) : int =
for i, x in s:
if pred x:
yield i