@@ -1026,9 +1026,9 @@ json_object_i(VALUE key, VALUE val, VALUE _arg)
10261026
10271027 if (RB_UNLIKELY (data -> state -> object_nl )) {
10281028 fbuffer_append_str (buffer , data -> state -> object_nl );
1029- }
1030- if ( RB_UNLIKELY ( data -> state -> indent )) {
1031- fbuffer_append_str_repeat ( buffer , data -> state -> indent , depth );
1029+ if ( data -> state -> indent ) {
1030+ fbuffer_append_str_repeat ( buffer , data -> state -> indent , depth );
1031+ }
10321032 }
10331033
10341034 VALUE key_to_s ;
@@ -1127,7 +1127,7 @@ static void generate_json_object(FBuffer *buffer, struct generate_json_data *dat
11271127 depth = -- data -> depth ;
11281128 if (RB_UNLIKELY (data -> state -> object_nl )) {
11291129 fbuffer_append_str (buffer , data -> state -> object_nl );
1130- if (RB_UNLIKELY ( data -> state -> indent ) ) {
1130+ if (data -> state -> indent ) {
11311131 fbuffer_append_str_repeat (buffer , data -> state -> indent , depth );
11321132 }
11331133 }
@@ -1151,15 +1151,15 @@ static void generate_json_array(FBuffer *buffer, struct generate_json_data *data
11511151 fbuffer_append_char (buffer , ',' );
11521152 if (RB_UNLIKELY (data -> state -> array_nl )) fbuffer_append_str (buffer , data -> state -> array_nl );
11531153 }
1154- if (RB_UNLIKELY (data -> state -> indent )) {
1154+ if (RB_UNLIKELY (data -> state -> array_nl && data -> state -> indent )) {
11551155 fbuffer_append_str_repeat (buffer , data -> state -> indent , depth );
11561156 }
11571157 generate_json (buffer , data , RARRAY_AREF (obj , i ));
11581158 }
11591159 data -> depth = -- depth ;
11601160 if (RB_UNLIKELY (data -> state -> array_nl )) {
11611161 fbuffer_append_str (buffer , data -> state -> array_nl );
1162- if (RB_UNLIKELY ( data -> state -> indent ) ) {
1162+ if (data -> state -> indent ) {
11631163 fbuffer_append_str_repeat (buffer , data -> state -> indent , depth );
11641164 }
11651165 }
0 commit comments