]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
change comparing instance methods
authorGuido van Rossum <guido@python.org>
Thu, 6 Apr 1995 14:46:51 +0000 (14:46 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 6 Apr 1995 14:46:51 +0000 (14:46 +0000)
Objects/classobject.c

index fd9da23e1a1b413861f1665709939fffe7b318b5..6ef17b2f56c8b77468744e03f7864f91d34193ad 100644 (file)
@@ -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 *