diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-31 19:17:18 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-31 19:17:18 +0000 |
commit | 30516bc301297cb35bf2c2e2f46290452a60f4b0 (patch) | |
tree | d5fec98a61ee1ad347f10c824c95490a5e98b6f7 /hash.c | |
parent | f152d79262cf5d6f5bd715f8a694c5e44bbad403 (diff) | |
download | ruby-30516bc301297cb35bf2c2e2f46290452a60f4b0.tar.gz |
* class.c (rb_class_has_methods): added to reduce depenedency
to internal class data structure.
* internal.h: ditto.
* hash.c (has_extra_methods): use added function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -37,8 +37,7 @@ has_extra_methods(VALUE klass) const VALUE base = rb_cHash; VALUE c = klass; while (c != base) { - st_table *mtbl = RCLASS_M_TBL(c); - if (mtbl && mtbl->num_entries) return klass; + if (rb_class_has_methods(c)) return klass; c = RCLASS_SUPER(c); } return 0; |