summaryrefslogtreecommitdiffstats
path: root/Objects/classobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-04-06 14:46:51 (GMT)
committerGuido van Rossum <guido@python.org>1995-04-06 14:46:51 (GMT)
commite9df727176faca694b5ef4daf1f423acdc683c3d (patch)
tree720d561b0e48bc8f4e7bfb29c5528f744e153a57 /Objects/classobject.c
parentf1bb33495024232d3b7d0d852436c66a875e21b2 (diff)
downloadcpython-e9df727176faca694b5ef4daf1f423acdc683c3d.zip
cpython-e9df727176faca694b5ef4daf1f423acdc683c3d.tar.gz
cpython-e9df727176faca694b5ef4daf1f423acdc683c3d.tar.bz2
change comparing instance methods
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r--Objects/classobject.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index fd9da23..6ef17b2 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -1209,10 +1209,9 @@ static int
instancemethod_compare(a, b)
instancemethodobject *a, *b;
{
- int cmp = cmpobject(a->im_self, b->im_self);
- if (cmp == 0)
- cmp = cmpobject(a->im_func, b->im_func);
- return cmp;
+ if (a->im_self != b->im_self)
+ return (a->im_self < b->im_self) ? -1 : 1;
+ return cmpobject(a->im_func, b->im_func);
}
static object *