Skip to content

Commit 613de30

Browse files
committed
[ruby/json] Use RB_TYPE_P
ruby/json@b14250f1da
1 parent 7592a00 commit 613de30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/json/generator/generator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ convert_string_subclass(VALUE key)
794794
{
795795
VALUE key_to_s = rb_funcall(key, i_to_s, 0);
796796

797-
if (RB_UNLIKELY(rb_type(key_to_s) != T_STRING)) {
797+
if (RB_UNLIKELY(!RB_TYPE_P(key_to_s, T_STRING))) {
798798
VALUE cname = rb_obj_class(key);
799799
rb_raise(rb_eTypeError,
800800
"can't convert %"PRIsVALUE" to %s (%"PRIsVALUE"#%s gives %"PRIsVALUE")",

0 commit comments

Comments
 (0)