ext/oj/mimic_json.c in oj-3.12.2 vs ext/oj/mimic_json.c in oj-3.12.3

- old
+ new

@@ -462,23 +462,23 @@ if (1 == argc) { h = rb_hash_new(); } else { h = argv[1]; } - if (Qfalse == rb_funcall(h, oj_has_key_id, 1, oj_indent_sym)) { + if (!oj_hash_has_key(h, oj_indent_sym)) { rb_hash_aset(h, oj_indent_sym, rb_str_new2(" ")); } - if (Qfalse == rb_funcall(h, oj_has_key_id, 1, oj_space_before_sym)) { + if (!oj_hash_has_key(h, oj_space_before_sym)) { rb_hash_aset(h, oj_space_before_sym, rb_str_new2("")); } - if (Qfalse == rb_funcall(h, oj_has_key_id, 1, oj_space_sym)) { + if (!oj_hash_has_key(h, oj_space_sym)) { rb_hash_aset(h, oj_space_sym, rb_str_new2(" ")); } - if (Qfalse == rb_funcall(h, oj_has_key_id, 1, oj_object_nl_sym)) { + if (!oj_hash_has_key(h, oj_object_nl_sym)) { rb_hash_aset(h, oj_object_nl_sym, rb_str_new2("\n")); } - if (Qfalse == rb_funcall(h, oj_has_key_id, 1, oj_array_nl_sym)) { + if (!oj_hash_has_key(h, oj_array_nl_sym)) { rb_hash_aset(h, oj_array_nl_sym, rb_str_new2("\n")); } if (Qundef == state_class) { oj_define_mimic_json(0, NULL, Qnil); } @@ -546,34 +546,34 @@ } if (Qnil != (v = rb_hash_lookup(ropts, oj_allow_nan_sym))) { pi.options.allow_nan = (Qtrue == v) ? Yes : No; } - if (Qtrue == rb_funcall(ropts, oj_has_key_id, 1, oj_hash_class_sym)) { + if (oj_hash_has_key(ropts, oj_hash_class_sym)) { if (Qnil == (v = rb_hash_lookup(ropts, oj_hash_class_sym))) { pi.options.hash_class = Qnil; } else { rb_check_type(v, T_CLASS); pi.options.hash_class = v; } } - if (Qtrue == rb_funcall(ropts, oj_has_key_id, 1, oj_object_class_sym)) { + if (oj_hash_has_key(ropts, oj_object_class_sym)) { if (Qnil == (v = rb_hash_lookup(ropts, oj_object_class_sym))) { pi.options.hash_class = Qnil; } else { rb_check_type(v, T_CLASS); pi.options.hash_class = v; } } - if (Qtrue == rb_funcall(ropts, oj_has_key_id, 1, oj_array_class_sym)) { + if (oj_hash_has_key(ropts, oj_array_class_sym)) { if (Qnil == (v = rb_hash_lookup(ropts, oj_array_class_sym))) { pi.options.array_class = Qnil; } else { rb_check_type(v, T_CLASS); pi.options.array_class = v; } } - if (Qtrue == rb_funcall(ropts, oj_has_key_id, 1, oj_decimal_class_sym)) { + if (oj_hash_has_key(ropts, oj_decimal_class_sym)) { pi.options.compat_bigdec = (oj_bigdecimal_class == rb_hash_lookup(ropts, oj_decimal_class_sym)); } v = rb_hash_lookup(ropts, oj_max_nesting_sym); if (Qtrue == v) {