summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-22 03:04:26 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-22 03:04:26 +0000
commit218b8324bb8aab829c2dcd2c473970827e5e1353 (patch)
tree7da83b12fba30596ca98940d890b9f26efa9aea8
parent8a6c76b5105e15d3d363218d094066afe87d45c5 (diff)
time.c (num_exact): use predefined IDs
No need to waste space on "to_r" and "to_int" which are predefined in defs/id.def git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--time.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/time.c b/time.c
index 0e1eb0a014..1f62f3699c 100644
--- a/time.c
+++ b/time.c
@@ -501,10 +501,10 @@ num_exact(VALUE v)
goto typeerror;
}
else {
- if ((tmp = rb_check_funcall(v, rb_intern("to_r"), 0, NULL)) != Qundef) {
+ if ((tmp = rb_check_funcall(v, idTo_r, 0, NULL)) != Qundef) {
/* test to_int method availability to reject non-Numeric
* objects such as String, Time, etc which have to_r method. */
- if (!rb_respond_to(v, rb_intern("to_int"))) goto typeerror;
+ if (!rb_respond_to(v, idTo_int)) goto typeerror;
}
else if (!NIL_P(tmp = rb_check_to_int(v))) {
return tmp;