Skip to content

Commit

Permalink
Simplify logic in Predicate.gather_required_columns implementations.
Browse files Browse the repository at this point in the history
  • Loading branch information
TallJimbo committed Dec 25, 2023
1 parent 4d7bfda commit 47b2991
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/lsst/daf/butler/queries/relation_tree/_predicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ class LogicalAnd(PredicateBase):

def gather_required_columns(self) -> set[ColumnReference]:
# Docstring inherited.
result = self.operands[0].gather_required_columns()
for operand in self.operands[1:]:
result: set[ColumnReference] = set()
for operand in self.operands:
result.update(operand.gather_required_columns())
return result

Expand Down Expand Up @@ -105,8 +105,8 @@ class LogicalOr(PredicateBase):

def gather_required_columns(self) -> set[ColumnReference]:
# Docstring inherited.
result = self.operands[0].gather_required_columns()
for operand in self.operands[1:]:
result: set[ColumnReference] = set()
for operand in self.operands:
result.update(operand.gather_required_columns())
return result

Expand Down

0 comments on commit 47b2991

Please sign in to comment.