diff mbox series

[02/11] runqueue: remove unused RunQueueExecute.sorted_setscene_tids; declare setscene_tids_generator in __init__

Message ID 20260827200603.688796-3-chris.laplante@agilent.com
State New
Headers show
Series runqueue correctness fixes, optimizations, and cleanups | expand

Commit Message

chris.laplante@agilent.com Aug. 27, 2026, 8:05 p.m. UTC
From: Chris Laplante <chris.laplante@agilent.com>

This makes the code a bit clearer by avoiding an ugly 'hasattr' call.

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
---
 lib/bb/runqueue.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 183475016..b2c2aaf14 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -1931,6 +1931,8 @@  class RunQueueExecute:
         self.tasks_notcovered = set()
         self.scenequeue_notneeded = set()
 
+        self.setscene_tids_generator = None
+
         schedulers = self.get_schedulers()
         for scheduler in schedulers:
             if self.scheduler == scheduler.name:
@@ -2202,9 +2204,7 @@  class RunQueueExecute:
         if self.updated_taskhash_queue or self.pending_migrations:
             self.process_possible_migrations()
 
-        if not hasattr(self, "sorted_setscene_tids"):
-            # Don't want to sort this set every execution
-            self.sorted_setscene_tids = sorted(self.rqdata.runq_setscene_tids)
+        if self.setscene_tids_generator is None:
             # Resume looping where we left off when we returned to feed the mainloop
             self.setscene_tids_generator = itertools.cycle(self.rqdata.runq_setscene_tids)