diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | re.c | 4 |
2 files changed, 7 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Thu Apr 28 16:52:05 2016 NARUSE, Yui <naruse@ruby-lang.org> + + * 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@ruby-lang.org> * lib/optparse.rb: [DOC] fix example code. base on the code by @@ -1384,7 +1384,7 @@ rb_reg_prepare_enc(VALUE re, VALUE str, int warn) 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) 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) |