Skip to content

Commit 8aeb67d

Browse files
committed
Remove a useless condition expression
`len` is always at least 1 here.
1 parent 705714b commit 8aeb67d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

random.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ rand_init(const rb_random_interface_t *rng, rb_random_t *rnd, VALUE seed)
378378
INTEGER_PACK_LSWORD_FIRST|INTEGER_PACK_NATIVE_BYTE_ORDER);
379379
if (sign < 0)
380380
sign = -sign;
381-
if (len <= 1) {
382-
rng->init_int32(rnd, len ? buf[0] : 0);
381+
if (len == 1) {
382+
rng->init_int32(rnd, buf[0]);
383383
}
384384
else {
385385
if (sign != 2 && buf[len-1] == 1) /* remove leading-zero-guard */

0 commit comments

Comments
 (0)