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 1QNWVH-0002zo-VM for garchives@archives.gentoo.org; Fri, 20 May 2011 20:41:00 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BCAFF1C026; Fri, 20 May 2011 20:40:51 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 8CF2F1C026 for ; Fri, 20 May 2011 20:40:51 +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 1204E1B401D for ; Fri, 20 May 2011 20:40:51 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 7151F8001E for ; Fri, 20 May 2011 20:40:50 +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/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/Task.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: fc199d55f5c293c4cef43b4fdd6a560e97f272d8 Date: Fri, 20 May 2011 20:40:50 +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: 25be77db95d81ee98888d2b6353419d3 commit: fc199d55f5c293c4cef43b4fdd6a560e97f272d8 Author: Zac Medico gentoo org> AuthorDate: Fri May 20 20:40:13 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Fri May 20 20:40:13 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Dfc199d55 Task: optimize =3D=3D and !=3D _hash_key comparison --- pym/_emerge/Task.py | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pym/_emerge/Task.py b/pym/_emerge/Task.py index 4dbdb11..3e1a4ba 100644 --- a/pym/_emerge/Task.py +++ b/pym/_emerge/Task.py @@ -6,10 +6,16 @@ class Task(SlotObject): __slots__ =3D ("_hash_key", "_hash_value") =20 def __eq__(self, other): - return self._hash_key =3D=3D other + try: + return self._hash_key =3D=3D other._hash_key + except AttributeError: + return False =20 def __ne__(self, other): - return self._hash_key !=3D other + try: + return self._hash_key !=3D other._hash_key + except AttributeError: + return True =20 def __hash__(self): return self._hash_value