From d479587426fb7b3e7cda3a65e28e1c11232fc2cd Mon Sep 17 00:00:00 2001 From: Allen Otis Date: Thu, 1 Sep 2011 13:11:19 -0700 Subject: remove reimplementation of rb_obj_is_kind_of and add some RTEST --- ext/json/ext/generator/generator.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/ext/json/ext/generator/generator.c b/ext/json/ext/generator/generator.c index 8ea0a63..e7d71e9 100644 --- a/ext/json/ext/generator/generator.c +++ b/ext/json/ext/generator/generator.c @@ -1022,13 +1022,6 @@ static VALUE cState_init_copy(VALUE obj, VALUE orig) return obj; } -#if defined(MAGLEV) -static int rb_obj_is_kind_of(VALUE obj, VALUE klass) -{ - return rb_obj_is_kind_of_(obj, klass); -} -#endif - /* * call-seq: from_state(opts) * @@ -1038,9 +1031,9 @@ static int rb_obj_is_kind_of(VALUE obj, VALUE klass) */ static VALUE cState_from_state_s(VALUE self, VALUE opts) { - if (rb_obj_is_kind_of(opts, self)) { + if (RTEST(rb_obj_is_kind_of(opts, self))) { return opts; - } else if (rb_obj_is_kind_of(opts, rb_cHash)) { + } else if (RTEST(rb_obj_is_kind_of(opts, rb_cHash))) { return rb_funcall(self, i_new, 1, opts); } else { if (NIL_P(CJSON_SAFE_STATE_PROTOTYPE)) { -- cgit v1.2.1