We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents abcfbc0 + 43835a0 commit 54b5f2bCopy full SHA for 54b5f2b
ext/json/ext/parser/parser.c
@@ -74,7 +74,7 @@ static VALUE CNaN, CInfinity, CMinusInfinity;
74
75
static ID i_json_creatable_p, i_json_create, i_create_id, i_create_additions,
76
i_chr, i_max_nesting, i_allow_nan, i_symbolize_names,
77
- i_object_class, i_array_class, i_decimal_class, i_key_p,
+ i_object_class, i_array_class, i_decimal_class,
78
i_deep_const_get, i_match, i_match_string, i_aset, i_aref,
79
i_leftshift, i_new, i_try_convert, i_freeze, i_uminus;
80
@@ -2180,7 +2180,6 @@ void Init_parser(void)
2180
i_decimal_class = rb_intern("decimal_class");
2181
i_match = rb_intern("match");
2182
i_match_string = rb_intern("match_string");
2183
- i_key_p = rb_intern("key?");
2184
i_deep_const_get = rb_intern("deep_const_get");
2185
i_aset = rb_intern("[]=");
2186
i_aref = rb_intern("[]");
ext/json/ext/parser/parser.h
@@ -7,7 +7,7 @@
7
# define MAYBE_UNUSED(x) x
8
#endif
9
10
-#define option_given_p(opts, key) RTEST(rb_funcall(opts, i_key_p, 1, key))
+#define option_given_p(opts, key) (rb_hash_lookup2(opts, key, Qundef) != Qundef)
11
12
typedef struct JSON_ParserStruct {
13
VALUE Vsource;
ext/json/ext/parser/parser.rl
@@ -72,7 +72,7 @@ static VALUE CNaN, CInfinity, CMinusInfinity;
72
73
@@ -940,7 +940,6 @@ void Init_parser(void)
940
941
942
943
944
945
946
0 commit comments