Skip to content

Commit

Permalink
unload data on iteration over leaves (#1534)
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb authored May 18, 2021
1 parent 5234bf1 commit a782b1d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sourmash/sbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,12 +1120,14 @@ def _parents(self, pos=0):
yield p.pos
p = self.parent(p.pos)

def leaves(self, with_pos=False):
def leaves(self, with_pos=False, unload_data=True):
for pos, data in self._leaves.items():
if with_pos:
yield (pos, data)
else:
yield data
if unload_data:
data.unload()

def combine(self, other):
larger, smaller = self, other
Expand Down

0 comments on commit a782b1d

Please sign in to comment.