Skip to content

Commit

Permalink
make 'find' a generator
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed Mar 9, 2021
1 parent 6b4be47 commit 70168f1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/sourmash/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ def find(self, search_fn, *args, **kwargs):

matches = []

for node in self.signatures():
if search_fn(node, *args):
matches.append(node)
return matches
for ss in self.signatures():
if search_fn(ss, *args):
yield ss

def search(self, query, *args, **kwargs):
"""Return set of matches with similarity above 'threshold'.
Expand Down

0 comments on commit 70168f1

Please sign in to comment.