summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-30 13:46:41 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-30 13:46:41 (GMT)
commite5a7c2db988db967140da2e11bdf8bb8e85d7769 (patch)
tree166b511cff19346eb98877fb00dcd759d4a82e75 /re.c
parent3b895e8355b06facb4e80b27e527d560af4fd65a (diff)
get rid of function calls in RSTRING_PTR
* process.c (rlimit_resource_type, rlimit_resource_value): get rid of function calls in RSTRING_PTR(), as it evaluates the argument twice. * re.c (match_backref_number): ditto. * signal.c (esignal_init, rb_f_kill, trap_signm): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47006 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 4bf18f5..d110fe6 100644
--- a/re.c
+++ b/re.c
@@ -1082,8 +1082,8 @@ match_backref_number(VALUE match, VALUE backref)
return NUM2INT(backref);
case T_SYMBOL:
- name = RSTRING_PTR(rb_sym2str(backref));
- break;
+ backref = rb_sym2str(backref);
+ /* fall through */
case T_STRING:
name = StringValueCStr(backref);