summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 *