summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-20 08:28:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-20 08:28:31 +0000
commit7f3b12f05b95745ae4766e085bf2d21298e4fa1b (patch)
treecf3e5742409d3bf53963ba7ed6c75b65f98185b1
parente3c3d4e4e5f111847d89de9dfc47e4b4c0080b70 (diff)
use predefined IDs
* array.c (rb_ary_equal), hash.c (hash_equal): use predefined IDs, `to_ary` and `to_hash` respectively. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--array.c2
-rw-r--r--hash.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/array.c b/array.c
index a32aad7811..915cb566d1 100644
--- a/array.c
+++ b/array.c
@@ -3759,7 +3759,7 @@ rb_ary_equal(VALUE ary1, VALUE ary2)
{
if (ary1 == ary2) return Qtrue;
if (!RB_TYPE_P(ary2, T_ARRAY)) {
- if (!rb_respond_to(ary2, rb_intern("to_ary"))) {
+ if (!rb_respond_to(ary2, idTo_ary)) {
return Qfalse;
}
return rb_equal(ary2, ary1);
diff --git a/hash.c b/hash.c
index 61f64101d3..93efde762a 100644
--- a/hash.c
+++ b/hash.c
@@ -1930,7 +1930,7 @@ hash_equal(VALUE hash1, VALUE hash2, int eql)
if (hash1 == hash2) return Qtrue;
if (!RB_TYPE_P(hash2, T_HASH)) {
- if (!rb_respond_to(hash2, rb_intern("to_hash"))) {
+ if (!rb_respond_to(hash2, idTo_hash)) {
return Qfalse;
}
if (eql)