diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-10-30 20:20:38 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-10-30 20:20:38 +0000 |
commit | 07aa48c574cebac89ffff8f411d51dbdfee5c93b (patch) | |
tree | fadf52902a7a2be9a8cc3e6d9c659aaa12af91d0 | |
parent | 49cc02aebf0b7dd13cb0ed5c46284ec9d85abd0d (diff) | |
download | portage-07aa48c574cebac89ffff8f411d51dbdfee5c93b.tar.gz portage-07aa48c574cebac89ffff8f411d51dbdfee5c93b.tar.bz2 portage-07aa48c574cebac89ffff8f411d51dbdfee5c93b.zip |
Avoid unnecessary aux_get calls inside Scheduler._pkg() by getting the existing
Package instance from the digraph.
svn path=/main/trunk/; revision=11752
-rw-r--r-- | pym/_emerge/__init__.py | 11 |
1 files changed, 7 insertions, 4 deletions
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): |