From: Zac Medico Date: Thu, 30 Oct 2008 20:20:38 +0000 (-0000) Subject: Avoid unnecessary aux_get calls inside Scheduler._pkg() by getting the existing X-Git-Tag: v2.2_rc13~36 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=07aa48c574cebac89ffff8f411d51dbdfee5c93b;p=portage.git Avoid unnecessary aux_get calls inside Scheduler._pkg() by getting the existing Package instance from the digraph. svn path=/main/trunk/; revision=11752 --- diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 5b220c4b2..8e2df4d58 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -10345,6 +10345,13 @@ class Scheduler(PollScheduler): if installed: operation = "nomerge" + if self._digraph is not None: + # Reuse existing instance when available. + pkg = self._digraph.get( + (type_name, root_config.root, cpv, operation)) + if pkg is not None: + return pkg + tree_type = depgraph.pkg_tree_map[type_name] db = root_config.trees[tree_type].dbapi db_keys = list(self.trees[root_config.root][ @@ -10357,10 +10364,6 @@ class Scheduler(PollScheduler): settings.setcpv(pkg) pkg.metadata["USE"] = settings["PORTAGE_USE"] - if self._digraph is not None: - # Reuse existing instance when available. - pkg = self._digraph.get(pkg, pkg) - return pkg class MetadataRegen(PollScheduler):