summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-12-09 13:47:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-12-09 13:47:54 +0000
commitca1a9450fbdcff96bdee09a14933a1ecf324489a (patch)
tree65e72d8b4ee0902d1716d02049d9f4602d357fed /enum.c
parentfa6dc283cd81445d4220018f49f5c82a572101fe (diff)
* enum.c (enum_sort_by): should replace with last elements.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/enum.c b/enum.c
index fb72849..352771f 100644
--- a/enum.c
+++ b/enum.c
@@ -250,7 +250,7 @@ enum_sort_by(obj)
rb_ary_sort_inplace(ary);
for (i=0; i<RARRAY(ary)->len; i++) {
VALUE e = RARRAY(ary)->ptr[i];
- RARRAY(ary)->ptr[i] = RARRAY(e)->ptr[2];
+ RARRAY(ary)->ptr[i] = RARRAY(e)->ptr[RARRAY(e)->len - 1];
}
return ary;