Skip to content

Commit a97f4c6

Browse files
byrootmatzbot
authored andcommitted
[ruby/json] parser.c: Appease GCC warning
``` ../../../../../../ext/json/ext/parser/parser.c:1142:40: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] 1142 | if (RB_UNLIKELY(first_digit == '0' && mantissa_digits > 1 || negative && mantissa_digits == 0)) { | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ ``` ruby/json@ded62a5122
1 parent ed7229e commit a97f4c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/json/parser/parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ static inline VALUE json_parse_number(JSON_ParserState *state, JSON_ParserConfig
11321132
// Parse integer part and extract mantissa digits
11331133
int mantissa_digits = json_parse_digits(state, &mantissa);
11341134

1135-
if (RB_UNLIKELY(first_digit == '0' && mantissa_digits > 1 || negative && mantissa_digits == 0)) {
1135+
if (RB_UNLIKELY((first_digit == '0' && mantissa_digits > 1) || (negative && mantissa_digits == 0))) {
11361136
raise_parse_error_at("invalid number: %s", state, start);
11371137
}
11381138

0 commit comments

Comments
 (0)