1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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:
卜部昌平 2021-06-24 11:57:40 +09:00
parent 31f4d26273
commit 0fbdaaf7c9
Notes: git 2021-06-24 12:48:38 +09:00

View file

@ -1196,7 +1196,7 @@ rand_bytes(const rb_random_interface_t *rng, rb_random_t *rnd, long n)
bytes = rb_str_new(0, n);
ptr = RSTRING_PTR(bytes);
rb_rand_bytes_int32(rng->get_int32, rnd, ptr, n);
rng->get_bytes(rnd, ptr, n);
return bytes;
}