From: Zac Medico Date: Mon, 7 Jan 2013 00:28:04 +0000 (-0800) Subject: MetadataRegen: simplify _iter_every_cp X-Git-Tag: v2.2.0_alpha150~24 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=085444eb5ad618a35107a1276da70f3ed7ca848c;p=portage.git MetadataRegen: simplify _iter_every_cp --- 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