summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'object.c')
-rw-r--r--object.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/object.c b/object.c
index 5b0f7dfdd7..3126ed01e6 100644
--- a/object.c
+++ b/object.c
@@ -206,9 +206,8 @@ rb_obj_not_equal(VALUE obj1, VALUE obj2)
VALUE
rb_class_real(VALUE cl)
{
- if (cl == 0)
- return 0;
- while ((RBASIC(cl)->flags & FL_SINGLETON) || BUILTIN_TYPE(cl) == T_ICLASS) {
+ while (cl &&
+ ((RBASIC(cl)->flags & FL_SINGLETON) || BUILTIN_TYPE(cl) == T_ICLASS)) {
cl = RCLASS_SUPER(cl);
}
return cl;