ruby-changes:13166
From: naruse <ko1@a...>
Date: Mon, 14 Sep 2009 10:11:20 +0900 (JST)
Subject: [ruby-changes:13166] Ruby:r24918 (trunk): * string.c (rb_str_inspect): use rb_enc_mbc_to_codepoint
naruse 2009-09-14 10:11:05 +0900 (Mon, 14 Sep 2009) New Revision: 24918 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24918 Log: * string.c (rb_str_inspect): use rb_enc_mbc_to_codepoint because we already knew char is found and got length. Modified files: trunk/ChangeLog trunk/string.c Index: ChangeLog =================================================================== --- ChangeLog (revision 24917) +++ ChangeLog (revision 24918) @@ -1,3 +1,8 @@ +Mon Sep 14 10:08:19 2009 NARUSE, Yui <naruse@r...> + + * string.c (rb_str_inspect): use rb_enc_mbc_to_codepoint + because we already knew char is found and got length. + Mon Sep 14 09:59:03 2009 NAKAMURA Usaku <usa@r...> * include/ruby/ruby.h (NUM2INT, NUM2LL, INT2NUM, UINT2NUM), Index: string.c =================================================================== --- string.c (revision 24917) +++ string.c (revision 24918) @@ -4278,8 +4278,7 @@ goto escape_codepoint; } n = MBCLEN_CHARFOUND_LEN(n); - - c = rb_enc_codepoint_len(p, pend, &n, enc); + c = rb_enc_mbc_to_codepoint(p, pend, enc); p += n; if (c == '"'|| c == '\\' || (c == '#' && -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/