summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-08-19 06:41:02 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-08-19 06:41:02 +0000
commitb818cdfaf390e0d721bb3e3809280b35fbcf1985 (patch)
tree23d9aad3d0aae7211c6d278aa986a05d1ccaf95a /array.c
parentae23000c0e0e4f4af1b4462147d950549b3abdbe (diff)
* array.c (sort_2): comparison should be done as signed long.
* array.c (sort_2): should return int, not VALUE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/array.c b/array.c
index 69bafe6..5311f2b 100644
--- a/array.c
+++ b/array.c
@@ -1089,12 +1089,12 @@ sort_2(ap, bp)
VALUE *ap, *bp;
{
VALUE retval;
- VALUE a = *ap, b = *ap;
+ long a = (long)*ap, b = (long)*ap;
if (FIXNUM_P(a) && FIXNUM_P(b)) {
- if (a > b) return INT2FIX(1);
- if (a < b) return INT2FIX(-1);
- return INT2FIX(0);
+ if (a > b) return 1;
+ if (a < b) return -1;
+ return 0;
}
if (TYPE(a) == T_STRING && TYPE(b) == T_STRING) {
return rb_str_cmp(a, b);