From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QJf8t-0006Ok-5t for garchives@archives.gentoo.org; Tue, 10 May 2011 05:05:55 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 511E11C009; Tue, 10 May 2011 05:05:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 21D241C009 for ; Tue, 10 May 2011 05:05:47 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AA0961B4074 for ; Tue, 10 May 2011 05:05:46 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id C026680505 for ; Tue, 10 May 2011 05:05:45 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/dbapi/vartree.py X-VCS-Directories: pym/portage/dbapi/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: e5a51b2b7952eabc56bed8e2e04b2596e7495e16 Date: Tue, 10 May 2011 05:05:45 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 9abe6000b806563a9ef8f680c8965c5b commit: e5a51b2b7952eabc56bed8e2e04b2596e7495e16 Author: Zac Medico gentoo org> AuthorDate: Tue May 10 05:05:40 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Tue May 10 05:05:40 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3De5a51b2b 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. --- 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 7c66027..41a9329 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 =3D self.cp_list max_counter =3D counter - for cp in self.cp_all(): - for cpv in cp_list(cp): - try: - pkg_counter =3D int(self.aux_get(cpv, ["COUNTER"])[0]) - except (KeyError, OverflowError, ValueError): - continue - if pkg_counter > max_counter: - max_counter =3D pkg_counter + for cpv in self.cpv_all(): + try: + pkg_counter =3D int(self.aux_get(cpv, ["COUNTER"])[0]) + except (KeyError, OverflowError, ValueError): + continue + if pkg_counter > max_counter: + max_counter =3D pkg_counter =20 if counter < 0 and not new_vdb: writemsg(_("!!! Initializing COUNTER to " \