]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
runqueue: simplify next buildable task
authorChris Larson <chris_larson@mentor.com>
Fri, 24 Dec 2010 00:04:07 +0000 (17:04 -0700)
committerChris Larson <chris_larson@mentor.com>
Fri, 24 Dec 2010 02:23:00 +0000 (19:23 -0700)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
lib/bb/runqueue.py

index 61849c3025f691f3a12c57629788c3ce6a1299ed..c4f716170d438a7543721dbc0970bc596452d51e 100644 (file)
@@ -88,7 +88,7 @@ class RunQueueScheduler(object):
         self.prio_map = []
         self.prio_map.extend(range(numTasks))
 
-    def next_buildable_tasks(self):
+    def next_buildable_task(self):
         """
         Return the id of the first task we find that is buildable
         """
@@ -97,14 +97,14 @@ class RunQueueScheduler(object):
             if self.rq.runq_running[taskid] == 1:
                 continue
             if self.rq.runq_buildable[taskid] == 1:
-                yield taskid
+                return taskid
 
     def next(self):
         """
         Return the id of the task we should build next
         """
         if self.rq.stats.active < self.rq.number_tasks:
-            return next(self.next_buildable_tasks(), None)
+            return self.next_buildable_task()
 
 class RunQueueSchedulerSpeed(RunQueueScheduler):
     """