summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllen Otis <otisa@vmware.com>2011-09-01 13:11:19 -0700
committerAllen Otis <otisa@vmware.com>2011-09-01 13:11:19 -0700
commitd479587426fb7b3e7cda3a65e28e1c11232fc2cd (patch)
tree48ad3b0b9a877904f07da17bbc3cd03e7f8d3bc4
parentb49f3ff1372fc9a943c50999f55597ebf94fc3cc (diff)
downloadjson-d479587426fb7b3e7cda3a65e28e1c11232fc2cd.tar.gz
remove reimplementation of rb_obj_is_kind_of and add some RTEST
-rw-r--r--ext/json/ext/generator/generator.c11
1 files 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)) {