summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-31 07:21:54 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-31 07:21:54 +0000
commit9b062c96857f2a9118268270dec500f8a037f5b8 (patch)
tree2147e0fab04533f9dee26324c30c45d70ea41725 /class.c
parente056ac59a776f87b7043d6c3d14e321ad5cd32d5 (diff)
* class.c (make_singleton_class): variable name changed.
removed an unnecessary conditional. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/class.c b/class.c
index 7b537e213a..865197b843 100644
--- a/class.c
+++ b/class.c
@@ -298,19 +298,14 @@ make_metaclass(VALUE klass)
static inline VALUE
make_singleton_class(VALUE obj)
{
- VALUE metasuper;
- VALUE super = RBASIC(obj)->klass;
- VALUE klass = rb_class_boot(super);
+ VALUE orig_class = RBASIC(obj)->klass;
+ VALUE klass = rb_class_boot(orig_class);
FL_SET(klass, FL_SINGLETON);
RBASIC(obj)->klass = klass;
rb_singleton_class_attached(klass, obj);
- metasuper = RBASIC(rb_class_real(super))->klass;
- /* metaclass of a superclass may be NULL at boot time */
- if (metasuper) {
- RBASIC(klass)->klass = metasuper;
- }
+ METACLASS_OF(klass) = METACLASS_OF(rb_class_real(orig_class));
return klass;
}