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

ruby-changes:53241

From: ko1 <ko1@a...>
Date: Wed, 31 Oct 2018 07:16:30 +0900 (JST)
Subject: [ruby-changes:53241] ko1:r65456 (trunk): fix type.

ko1	2018-10-31 07:16:26 +0900 (Wed, 31 Oct 2018)

  New Revision: 65456

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

  Log:
    fix type.
    
    * string.c (rb_str_format_m): should pass `int`.

  Modified files:
    trunk/string.c
Index: string.c
===================================================================
--- string.c	(revision 65455)
+++ string.c	(revision 65456)
@@ -2006,9 +2006,7 @@ rb_str_format_m(VALUE str, VALUE arg) https://github.com/ruby/ruby/blob/trunk/string.c#L2006
     VALUE tmp = rb_check_array_type(arg);
 
     if (!NIL_P(tmp)) {
-        const long len = RARRAY_LENINT(tmp);
-        VALUE rv = rb_str_format(len, RARRAY_CONST_PTR(tmp), str);
-        return rv;
+        return rb_str_format(RARRAY_LENINT(tmp), RARRAY_CONST_PTR(tmp), str);
     }
     return rb_str_format(1, &arg, str);
 }

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

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