rand_bytes: prefer rng->get_bytes
Because why not. There was no use case of rng->get_bytes before this changeset.
This commit is contained in:
parent
31f4d26273
commit
0fbdaaf7c9
Notes:
git
2021-06-24 12:48:38 +09:00
2
random.c
2
random.c
@ -1196,7 +1196,7 @@ rand_bytes(const rb_random_interface_t *rng, rb_random_t *rnd, long n)
|
|||||||
|
|
||||||
bytes = rb_str_new(0, n);
|
bytes = rb_str_new(0, n);
|
||||||
ptr = RSTRING_PTR(bytes);
|
ptr = RSTRING_PTR(bytes);
|
||||||
rb_rand_bytes_int32(rng->get_int32, rnd, ptr, n);
|
rng->get_bytes(rnd, ptr, n);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user