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

ruby-changes:45937

From: Hello <ko1@a...>
Date: Sat, 18 Mar 2017 08:42:15 +0900 (JST)
Subject: [ruby-changes:45937] Re: duerst:r58000 (trunk): clarifiy 'codepoint' in documentation of String#each_codepoint

Hello Eric,

On 2017/03/17 17:12, Eric Wong wrote:
> duerst@r... wrote:
>> duerst	2017-03-17 11:24:53 +0900 (Fri, 17 Mar 2017)
>>
>>   New Revision: 58000
>>
>>   https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58000
>
> Hi Martin, I think you inadvertantly clobbered my r57997 change
> to use rb_fstring_cstr with this.
>
> Bad merge conflict resolution?

Yes. Sorry, I really have absolutely no idea why there's a change on 
line 4150 at 
https://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/string.c?r1=58000&r2=57999&pathrev=58000&diff_format=h. 
I just changed the comment around line 7968. Please fix line 4150 the 
way you think it should be.

Regards,   Martin.
Index: string.c
===================================================================
--- string.c	(revision 57999)
+++ string.c	(revision 58000)
@@ -4147,7 +4147,7 @@ str_upto_each(VALUE beg, VALUE end, int https://github.com/ruby/ruby/blob/trunk/string.c#L4147
 	}
 	else {
 	    ID op = excl ? '<' : idLE;
-	    VALUE args[2], fmt = rb_fstring_cstr("%.*d");
+	    VALUE args[2], fmt = rb_obj_freeze(rb_usascii_str_new_cstr("%.*d"));
 
 	    args[0] = INT2FIX(width);
 	    while (rb_funcall(b, op, 1, e)) {
@@ -7965,7 +7965,9 @@ rb_str_enumerate_codepoints(VALUE str, i https://github.com/ruby/ruby/blob/trunk/string.c#L7965
  *
  *  Passes the <code>Integer</code> ordinal of each character in <i>str</i>,
  *  also known as a <i>codepoint</i> when applied to Unicode strings to the
- *  given block.
+ *  given block.  For encodings other than UTF-8/UTF-16(BE|LE)/UTF-32(BE|LE),
+ *  values are directly derived from the binary representation
+ *  of each character.
  *
  *  If no block is given, an enumerator is returned instead.
  *

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

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