diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-31 07:21:54 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-31 07:21:54 +0000 |
| commit | acf940234b07d3aa5dbf06642a3895b5776b678b (patch) | |
| tree | 2147e0fab04533f9dee26324c30c45d70ea41725 | |
| parent | 6016abfe06c5125443bc1cdb9ad2c5696f3d843a (diff) | |
| download | ruby-acf940234b07d3aa5dbf06642a3895b5776b678b.tar.gz ruby-acf940234b07d3aa5dbf06642a3895b5776b678b.tar.xz ruby-acf940234b07d3aa5dbf06642a3895b5776b678b.zip | |
* class.c (make_singleton_class): variable name changed.
removed an unnecessary conditional.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | class.c | 11 |
2 files changed, 8 insertions, 8 deletions
@@ -1,3 +1,8 @@ +Mon Aug 31 16:20:41 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp> + + * class.c (make_singleton_class): variable name changed. + removed an unnecessary conditional. + Mon Aug 31 14:17:09 2009 Yuki Sonoda (Yugui) <yugui@yugui.jp> * class.c: refactored singleton class related matters. @@ -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; } |
