Skip to content

Commit 256cad5

Browse files
committed
Use booleans in string_scan
1 parent 2a4ebe8 commit 256cad5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/json/ext/parser/parser.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -937,27 +937,27 @@ static ALWAYS_INLINE() bool string_scan(JSON_ParserState *state)
937937
uint64_t mask = 0;
938938
if (string_scan_simd_neon(&state->cursor, state->end, &mask)) {
939939
state->cursor += trailing_zeros64(mask) >> 2;
940-
return 1;
940+
return true;
941941
}
942942

943943
#elif defined(HAVE_SIMD_SSE2)
944944
if (simd_impl == SIMD_SSE2) {
945945
int mask = 0;
946946
if (string_scan_simd_sse2(&state->cursor, state->end, &mask)) {
947947
state->cursor += trailing_zeros(mask);
948-
return 1;
948+
return true;
949949
}
950950
}
951951
#endif /* HAVE_SIMD_NEON or HAVE_SIMD_SSE2 */
952952
#endif /* HAVE_SIMD */
953953

954954
while (!eos(state)) {
955955
if (RB_UNLIKELY(string_scan_table[(unsigned char)*state->cursor])) {
956-
return 1;
956+
return true;
957957
}
958958
state->cursor++;
959959
}
960-
return 0;
960+
return false;
961961
}
962962

963963
static inline VALUE json_parse_string(JSON_ParserState *state, JSON_ParserConfig *config, bool is_name)

0 commit comments

Comments
 (0)