summaryrefslogtreecommitdiffstats
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
commita97fb8b88f09d753c27713665e8bf8c5ce3b83a1 (patch)
tree23d9aad3d0aae7211c6d278aa986a05d1ccaf95a /array.c
parent2753f846938e5edfd164de9d1c72d5bce7c593ec (diff)
downloadruby-a97fb8b88f09d753c27713665e8bf8c5ce3b83a1.tar.gz
ruby-a97fb8b88f09d753c27713665e8bf8c5ce3b83a1.tar.xz
ruby-a97fb8b88f09d753c27713665e8bf8c5ce3b83a1.zip
* array.c (sort_2): comparison should be done as signed long.
* array.c (sort_2): should return int, not VALUE. git-svn-id: http://svn.ruby-lang.org/repos/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 69bafe643..5311f2b9d 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);