summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2025-11-22 10:32:16 +0100
committergit <svn-admin@ruby-lang.org>2025-11-22 09:32:48 +0000
commitec296f63e33e78a95a20378b689efc0bf74f271a (patch)
tree153ffe3b2263f3315c893085822bd6e8152e695f
parent7789aaca3736fdac2c00b141b12f127168c485cd (diff)
[ruby/json] Use booleans in string_scan
https://github.com/ruby/json/commit/256cad5def
-rw-r--r--ext/json/parser/parser.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/json/parser/parser.c b/ext/json/parser/parser.c
index 2dcd1012b1..cb22648dbc 100644
--- a/ext/json/parser/parser.c
+++ b/ext/json/parser/parser.c
@@ -937,7 +937,7 @@ static ALWAYS_INLINE() bool string_scan(JSON_ParserState *state)
uint64_t mask = 0;
if (string_scan_simd_neon(&state->cursor, state->end, &mask)) {
state->cursor += trailing_zeros64(mask) >> 2;
- return 1;
+ return true;
}
#elif defined(HAVE_SIMD_SSE2)
@@ -945,7 +945,7 @@ static ALWAYS_INLINE() bool string_scan(JSON_ParserState *state)
int mask = 0;
if (string_scan_simd_sse2(&state->cursor, state->end, &mask)) {
state->cursor += trailing_zeros(mask);
- return 1;
+ return true;
}
}
#endif /* HAVE_SIMD_NEON or HAVE_SIMD_SSE2 */
@@ -953,11 +953,11 @@ static ALWAYS_INLINE() bool string_scan(JSON_ParserState *state)
while (!eos(state)) {
if (RB_UNLIKELY(string_scan_table[(unsigned char)*state->cursor])) {
- return 1;
+ return true;
}
state->cursor++;
}
- return 0;
+ return false;
}
static inline VALUE json_parse_string(JSON_ParserState *state, JSON_ParserConfig *config, bool is_name)