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 <gentoo-commits+bounces-347735-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1QPTyL-0003U8-9W
	for garchives@archives.gentoo.org; Thu, 26 May 2011 06:23:05 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 02D671C4FD;
	Thu, 26 May 2011 06:18:34 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id C94EA1C4FD
	for <gentoo-commits@lists.gentoo.org>; Thu, 26 May 2011 06:18:34 +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 90E581B4037
	for <gentoo-commits@lists.gentoo.org>; Thu, 26 May 2011 06:18:34 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by pelican.gentoo.org (Postfix) with ESMTP id 020F58050E
	for <gentoo-commits@lists.gentoo.org>; Thu, 26 May 2011 06:18:34 +0000 (UTC)
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" <zmedico@gentoo.org>
Message-ID: <6dddcdf40fec90d4eaab3417b67dcc849c2547c7.zmedico@gentoo>
Subject: [gentoo-commits] proj/portage:2.1.9 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: 6dddcdf40fec90d4eaab3417b67dcc849c2547c7
Date: Thu, 26 May 2011 06:18:34 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: quoted-printable
X-Archives-Salt: 
X-Archives-Hash: cfc174c7dde2f5d9ce89791b160bdcfa

commit:     6dddcdf40fec90d4eaab3417b67dcc849c2547c7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri May 20 20:40:13 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu May 26 03:36:17 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a=
=3Dcommit;h=3D6dddcdf4

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