summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-05-09 22:05:40 -0700
committerZac Medico <zmedico@gentoo.org>2011-05-09 22:05:40 -0700
commite5a51b2b7952eabc56bed8e2e04b2596e7495e16 (patch)
tree546e2a11a4bd09c5d15dd2eca70512a2ce6330d4
parent928bc527a8c3eab3784df54226df2f2d83c6c85c (diff)
downloadportage-e5a51b2b7952eabc56bed8e2e04b2596e7495e16.tar.gz
portage-e5a51b2b7952eabc56bed8e2e04b2596e7495e16.tar.bz2
portage-e5a51b2b7952eabc56bed8e2e04b2596e7495e16.zip
get_counter_tick_core: use cpv_all
It's more efficient to use cpv_all since cp_all calls cpv_all anyway, and calls to cp_list induce additional stat calls.
-rw-r--r--pym/portage/dbapi/vartree.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 7c6602752..41a932991 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -764,16 +764,14 @@ class vardbapi(dbapi):
# to newly installed packages having lower
# COUNTERs than the previous version in the
# same slot.
- cp_list = self.cp_list
max_counter = counter
- for cp in self.cp_all():
- for cpv in cp_list(cp):
- try:
- pkg_counter = int(self.aux_get(cpv, ["COUNTER"])[0])
- except (KeyError, OverflowError, ValueError):
- continue
- if pkg_counter > max_counter:
- max_counter = pkg_counter
+ for cpv in self.cpv_all():
+ try:
+ pkg_counter = int(self.aux_get(cpv, ["COUNTER"])[0])
+ except (KeyError, OverflowError, ValueError):
+ continue
+ if pkg_counter > max_counter:
+ max_counter = pkg_counter
if counter < 0 and not new_vdb:
writemsg(_("!!! Initializing COUNTER to " \