From 085444eb5ad618a35107a1276da70f3ed7ca848c Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 6 Jan 2013 16:28:04 -0800 Subject: [PATCH] MetadataRegen: simplify _iter_every_cp --- pym/_emerge/MetadataRegen.py | 10 +++------- .../ebuild/_parallel_manifest/ManifestScheduler.py | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/pym/_emerge/MetadataRegen.py b/pym/_emerge/MetadataRegen.py index 213fc3df9..bdf2fa7ea 100644 --- a/pym/_emerge/MetadataRegen.py +++ b/pym/_emerge/MetadataRegen.py @@ -35,14 +35,10 @@ class MetadataRegen(AsyncScheduler): def _iter_every_cp(self): # List categories individually, in order to start yielding quicker, # and in order to reduce latency in case of a signal interrupt. - categories = sorted(self._portdb.settings.categories, reverse=True) cp_all = self._portdb.cp_all - - while categories: - category = categories.pop() - category_cps = cp_all(categories=(category,), reverse=True) - while category_cps: - yield category_cps.pop() + for category in sorted(self._portdb.categories): + for cp in cp_all(categories=(category,)): + yield cp def _iter_metadata_processes(self): portdb = self._portdb diff --git a/pym/portage/package/ebuild/_parallel_manifest/ManifestScheduler.py b/pym/portage/package/ebuild/_parallel_manifest/ManifestScheduler.py index 8839989a1..38ac4825e 100644 --- a/pym/portage/package/ebuild/_parallel_manifest/ManifestScheduler.py +++ b/pym/portage/package/ebuild/_parallel_manifest/ManifestScheduler.py @@ -32,14 +32,10 @@ class ManifestScheduler(AsyncScheduler): def _iter_every_cp(self): # List categories individually, in order to start yielding quicker, # and in order to reduce latency in case of a signal interrupt. - categories = sorted(self._portdb.settings.categories, reverse=True) cp_all = self._portdb.cp_all - - while categories: - category = categories.pop() - category_cps = cp_all(categories=(category,), reverse=True) - while category_cps: - yield category_cps.pop() + for category in sorted(self._portdb.categories): + for cp in cp_all(categories=(category,)): + yield cp def _iter_tasks(self): portdb = self._portdb -- 2.26.2