mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
return shared string
* re.c (rb_reg_source): return shared string without copying. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
94c70c7d72
commit
25fd278459
1 changed files with 1 additions and 1 deletions
2
re.c
2
re.c
|
@ -500,7 +500,7 @@ rb_reg_source(VALUE re)
|
|||
VALUE str;
|
||||
|
||||
rb_reg_check(re);
|
||||
str = rb_enc_str_new(RREGEXP_SRC_PTR(re),RREGEXP_SRC_LEN(re), rb_enc_get(re));
|
||||
str = rb_str_dup(RREGEXP_SRC(re));
|
||||
if (OBJ_TAINTED(re)) OBJ_TAINT(str);
|
||||
return str;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue