[前][次][番号順一覧][スレッド一覧]

ruby-changes:43903

From: mrkn <ko1@a...>
Date: Sun, 21 Aug 2016 05:51:28 +0900 (JST)
Subject: [ruby-changes:43903] mrkn:r55975 (trunk): enum.c (enum_sort): prevent wasteful array duplicaion

mrkn	2016-08-21 05:51:19 +0900 (Sun, 21 Aug 2016)

  New Revision: 55975

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55975

  Log:
    enum.c (enum_sort): prevent wasteful array duplicaion

  Modified files:
    trunk/ChangeLog
    trunk/enum.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 55974)
+++ ChangeLog	(revision 55975)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Aug 21 05:47:00 2016  Kenta Murata  <mrkn@m...>
+
+	* enum.c (enum_sort): prevent wasteful array duplicaion.
+
 Sat Aug 20 11:20:32 2016  Nobuyoshi Nakada  <nobu@r...>
 
 	* rubystub.c: generalize win32/stub.c.
Index: enum.c
===================================================================
--- enum.c	(revision 55974)
+++ enum.c	(revision 55975)
@@ -938,7 +938,7 @@ enum_first(int argc, VALUE *argv, VALUE https://github.com/ruby/ruby/blob/trunk/enum.c#L938
 static VALUE
 enum_sort(VALUE obj)
 {
-    return rb_ary_sort(enum_to_a(0, 0, obj));
+    return rb_ary_sort_bang(enum_to_a(0, 0, obj));
 }
 
 #define SORT_BY_BUFSIZE 16

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]