Skip to content

Commit 61ee2ea

Browse files
authored
Partial Optimization
1 parent 5655c2f commit 61ee2ea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python/egglog/declarations.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,11 +570,15 @@ def _cached_hash(self) -> int:
570570
return hash((self.callable, self.args, self.bound_tp_params))
571571

572572
def __eq__(self, other: object) -> bool:
573+
# Override eq to use cached hash for perf
573574
if not isinstance(other, CallDecl):
574575
return False
576+
if hash(self) != hash(other):
577+
return False
575578
return self.callable == other.callable and self.args == other.args and self.bound_tp_params == other.bound_tp_params
576579

577580

581+
578582
@dataclass(frozen=True)
579583
class PartialCallDecl:
580584
"""

0 commit comments

Comments
 (0)