aboutsummaryrefslogtreecommitdiffstats
path: root/re.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-28 07:52:59 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-28 07:52:59 +0000
commit9d1fb6ad429bd11f57542bc47c09e509761245cc (patch)
treed34166148c576b022cf5a2ebb7c590b23b7adc30 /re.c
parent89a7ee27ea6447587c3e01f67f50779e7e9290fc (diff)
downloadruby-9d1fb6ad429bd11f57542bc47c09e509761245cc.tar.gz
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/re.c b/re.c
index e8c42b7705..b515b9f2f8 100644
--- a/re.c
+++ b/re.c
@@ -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)