projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c534640
)
Task: optimize == and != _hash_key comparison
author
Zac Medico
<zmedico@gentoo.org>
Fri, 20 May 2011 20:40:13 +0000
(13:40 -0700)
committer
Zac Medico
<zmedico@gentoo.org>
Thu, 26 May 2011 03:36:17 +0000
(20:36 -0700)
pym/_emerge/Task.py
patch
|
blob
|
history
diff --git
a/pym/_emerge/Task.py
b/pym/_emerge/Task.py
index 4dbdb11854f0cfa95210b117c1551c0a7dde1596..3e1a4ba629aedabc97d0d4c5517e7375ba505296 100644
(file)
--- a/
pym/_emerge/Task.py
+++ b/
pym/_emerge/Task.py
@@
-6,10
+6,16
@@
class Task(SlotObject):
__slots__ = ("_hash_key", "_hash_value")
def __eq__(self, other):
- return self._hash_key == other
+ try:
+ return self._hash_key == other._hash_key
+ except AttributeError:
+ return False
def __ne__(self, other):
- return self._hash_key != other
+ try:
+ return self._hash_key != other._hash_key
+ except AttributeError:
+ return True
def __hash__(self):
return self._hash_value