We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
collections.deque
1 parent 7a075d1 commit 367b96eCopy full SHA for 367b96e
1 file changed
flixopt/effects.py
@@ -9,6 +9,7 @@
9
10
import logging
11
import warnings
12
+from collections import deque
13
from collections.abc import Iterator
14
from typing import TYPE_CHECKING, Literal
15
@@ -570,10 +571,10 @@ def calculate_all_conversion_paths(
570
571
# Keep track of visited paths to avoid repeating calculations
572
processed_paths = set()
573
# Use a queue with (current_domain, factor, path_history)
- queue = [(origin, 1, [origin])]
574
+ queue = deque([(origin, 1, [origin])])
575
576
while queue:
- current_domain, factor, path = queue.pop(0)
577
+ current_domain, factor, path = queue.popleft()
578
579
# Skip if we've processed this exact path before
580
path_key = tuple(path)
0 commit comments