Remove a useless condition expression
`len` is always at least 1 here.
This commit is contained in:
parent
705714be3e
commit
8aeb67de7d
Notes:
git
2024-11-29 15:03:27 +00:00
4
random.c
4
random.c
@ -378,8 +378,8 @@ rand_init(const rb_random_interface_t *rng, rb_random_t *rnd, VALUE seed)
|
|||||||
INTEGER_PACK_LSWORD_FIRST|INTEGER_PACK_NATIVE_BYTE_ORDER);
|
INTEGER_PACK_LSWORD_FIRST|INTEGER_PACK_NATIVE_BYTE_ORDER);
|
||||||
if (sign < 0)
|
if (sign < 0)
|
||||||
sign = -sign;
|
sign = -sign;
|
||||||
if (len <= 1) {
|
if (len == 1) {
|
||||||
rng->init_int32(rnd, len ? buf[0] : 0);
|
rng->init_int32(rnd, buf[0]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (sign != 2 && buf[len-1] == 1) /* remove leading-zero-guard */
|
if (sign != 2 && buf[len-1] == 1) /* remove leading-zero-guard */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user