diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-05-09 22:05:40 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-05-11 22:19:53 -0700 |
commit | d53dfac16cfc793b7f55069bfa49c3544a73bd2a (patch) | |
tree | 6eafd99d79c7695350fc1d923da5c5fd42bbedaf /pym | |
parent | e0b4f2971245506750cb013a4fda8251111e1c46 (diff) | |
download | portage-d53dfac16cfc793b7f55069bfa49c3544a73bd2a.tar.gz portage-d53dfac16cfc793b7f55069bfa49c3544a73bd2a.tar.bz2 portage-d53dfac16cfc793b7f55069bfa49c3544a73bd2a.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.
Diffstat (limited to 'pym')
-rw-r--r-- | pym/portage/dbapi/vartree.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index a12997389..a54adc078 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -755,16 +755,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 " \ |