aboutsummaryrefslogtreecommitdiffstats
path: root/class.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-31 19:17:18 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-31 19:17:18 +0000
commit30516bc301297cb35bf2c2e2f46290452a60f4b0 (patch)
treed5fec98a61ee1ad347f10c824c95490a5e98b6f7 /class.c
parentf152d79262cf5d6f5bd715f8a694c5e44bbad403 (diff)
downloadruby-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 'class.c')
-rw-r--r--class.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/class.c b/class.c
index 37ad4b542b..2409e0d68b 100644
--- a/class.c
+++ b/class.c
@@ -1985,6 +1985,13 @@ rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, V
#undef extract_kwarg
}
+int
+rb_class_has_methods(VALUE c)
+{
+ st_table *mtbl = RCLASS_M_TBL(c);
+ return mtbl && mtbl->num_entries ? TRUE : FALSE;
+}
+
/*!
* \}
*/