aboutsummaryrefslogtreecommitdiffstats
path: root/re.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-29 17:49:33 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-29 17:49:33 +0000
commit17ab7d07915a401a54c11e443db379f09fcc54ab (patch)
treea3ec4bf73e8dca867ec4be5ae570a1e86ff87f34 /re.c
parentf5ff49ebe2232bcb8acd84d1822fb05c5efc0057 (diff)
downloadruby-17ab7d07915a401a54c11e443db379f09fcc54ab.tar.gz
no-op if it is T_STRING
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/re.c b/re.c
index c5c533781a..394fc46129 100644
--- a/re.c
+++ b/re.c
@@ -3084,6 +3084,9 @@ reg_operand(VALUE s, int check)
if (SYMBOL_P(s)) {
return rb_sym2str(s);
}
+ else if (RB_TYPE_P(s, T_STRING)) {
+ return s;
+ }
else {
return check ? rb_str_to_str(s) : rb_check_string_type(s);
}