aboutsummaryrefslogtreecommitdiffstats
path: root/process.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-30 13:46:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-30 13:46:41 +0000
commite5a7c2db988db967140da2e11bdf8bb8e85d7769 (patch)
tree166b511cff19346eb98877fb00dcd759d4a82e75 /process.c
parent3b895e8355b06facb4e80b27e527d560af4fd65a (diff)
downloadruby-e5a7c2db988db967140da2e11bdf8bb8e85d7769.tar.gz
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 'process.c')
-rw-r--r--process.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/process.c b/process.c
index e9d1b0638f..bcccddcdcd 100644
--- a/process.c
+++ b/process.c
@@ -4529,7 +4529,8 @@ rlimit_resource_type(VALUE rtype)
switch (TYPE(rtype)) {
case T_SYMBOL:
- name = RSTRING_PTR(rb_sym2str(rtype));
+ v = rb_sym2str(rtype);
+ name = RSTRING_PTR(v);
break;
default:
@@ -4564,7 +4565,8 @@ rlimit_resource_value(VALUE rval)
switch (TYPE(rval)) {
case T_SYMBOL:
- name = RSTRING_PTR(rb_sym2str(rval));
+ v = rb_sym2str(rval);
+ name = RSTRING_PTR(v);
break;
default: