From 9f9608731263b7b3b3e8dfd22a9d579cb650cd54 Mon Sep 17 00:00:00 2001 From: Sean McIntyre Date: Sun, 22 Jan 2023 21:21:24 +0100 Subject: [PATCH] Short-circuit set operations for nice speed boost --- core/dbt/graph/queue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/dbt/graph/queue.py b/core/dbt/graph/queue.py index 3c3b9625d27..dd439faf37e 100644 --- a/core/dbt/graph/queue.py +++ b/core/dbt/graph/queue.py @@ -161,7 +161,7 @@ def _find_new_additions(self) -> None: queue and add them. """ for node, in_degree in self.graph.in_degree(): - if not self._already_known(node) and in_degree == 0: + if in_degree == 0 and not self._already_known(node): self.inner.put((self._scores[node], node)) self.queued.add(node)