1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2015-04-14 03:31:28 +00:00
parent 3dba6dabb6
commit 523ecd29b8
3 changed files with 6 additions and 6 deletions

View file

@ -22,7 +22,7 @@ constant_arg(VALUE arg, int (*str_to_int)(const char*, long, int*), const char *
int ret;
if (SYMBOL_P(arg)) {
arg = rb_sym_to_s(arg);
arg = rb_sym2str(arg);
goto str;
}
else if (!NIL_P(tmp = rb_check_string_type(arg))) {