Skip to content

Commit b14250f

Browse files
committed
Use RB_TYPE_P
1 parent 05cc998 commit b14250f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/json/ext/generator/generator.c

+1-1
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)