Skip to content

Commit

Permalink
put loop in index_multi_select higher
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownUser95 authored and anafvana committed Jul 27, 2024
1 parent 66a13dc commit e086958
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/pickpack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,13 @@ def get_selected_no_index(self) -> NodeNameOnly | list[NodeNameOnly]:
def index_multi_select(self) -> list[NodeWithIndex]:
nodes: list[tuple[str | Node, int]] = []

if self.output_leaves_only:
for selected in self.all_selected:
for selected in self.all_selected:
if self.output_leaves_only:
node: Node = find_by_index(self.options.node, selected)
nodes.extend([(leaf, leaf.index) for leaf in get_leaves_only(node) if (leaf, leaf.index) not in nodes])
else:
for selected in self.all_selected:
else:
nodes.append((find_by_index(self.options.node, selected), selected))

if self.name_only:
nodes = [(n[0].name, n[1]) for n in nodes]

Expand Down

0 comments on commit e086958

Please sign in to comment.