ruby-changes:42735
From: naruse <ko1@a...>
Date: Thu, 28 Apr 2016 15:56:23 +0900 (JST)
Subject: [ruby-changes:42735] naruse:r54809 (trunk): * re.c (rb_reg_prepare_enc): use rb_enc_asciicompat(enc) instead of
naruse 2016-04-28 16:52:59 +0900 (Thu, 28 Apr 2016) New Revision: 54809 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54809 Log: * re.c (rb_reg_prepare_enc): use rb_enc_asciicompat(enc) instead of rb_enc_str_asciicompat_p(str) to avoid useless rb_enc_get(str) call. Modified files: trunk/ChangeLog trunk/re.c Index: re.c =================================================================== --- re.c (revision 54808) +++ re.c (revision 54809) @@ -1384,7 +1384,7 @@ rb_reg_prepare_enc(VALUE re, VALUE str, https://github.com/ruby/ruby/blob/trunk/re.c#L1384 rb_reg_check(re); enc = rb_enc_get(str); - if (!rb_enc_str_asciicompat_p(str)) { + if (!rb_enc_asciicompat(enc)) { if (RREGEXP_PTR(re)->enc != enc) { reg_enc_error(re, str); } @@ -3408,7 +3408,7 @@ rb_reg_s_union(VALUE self, VALUE args0) https://github.com/ruby/ruby/blob/trunk/re.c#L3408 rb_encoding *enc; StringValue(e); enc = rb_enc_get(e); - if (!rb_enc_str_asciicompat_p(e)) { + if (!rb_enc_asciicompat(enc)) { if (!has_ascii_incompat) has_ascii_incompat = enc; else if (has_ascii_incompat != enc) Index: ChangeLog =================================================================== --- ChangeLog (revision 54808) +++ ChangeLog (revision 54809) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Apr 28 16:52:05 2016 NARUSE, Yui <naruse@r...> + + * re.c (rb_reg_prepare_enc): use rb_enc_asciicompat(enc) instead of + rb_enc_str_asciicompat_p(str) to avoid useless rb_enc_get(str) call. + Thu Apr 28 16:33:41 2016 Nobuyoshi Nakada <nobu@r...> * lib/optparse.rb: [DOC] fix example code. base on the code by -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/