summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-14 03:31:28 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-14 03:31:28 (GMT)
commit523ecd29b8acef4faa47331aaf1c6bf128b29ad6 (patch)
treedc1398668220ed51b8e352efb03713fa425de2a1 /re.c
parent3dba6dabb6b5794be9f5f17277fd256ef74c6caf (diff)
use frozen string of symbols
* range.c (range_step, range_each): String#upto should never modifies the receiver, use frozen strings to enumerate symbols. * re.c (reg_operand): matching target is not modified. * ext/socket/constants.c (constant_arg): str_to_int never modifies argument strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/re.c b/re.c
index 7e789f5..207a77d 100644
--- a/re.c
+++ b/re.c
@@ -2753,7 +2753,7 @@ static VALUE
reg_operand(VALUE s, int check)
{
if (SYMBOL_P(s)) {
- return rb_sym_to_s(s);
+ return rb_sym2str(s);
}
else {
return (check ? rb_str_to_str : rb_check_string_type)(s);