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:
parent
31f4d26273
commit
0fbdaaf7c9
Notes:
git
2021-06-24 12:48:38 +09:00
1 changed files with 1 additions and 1 deletions
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);
|
||||
ptr = RSTRING_PTR(bytes);
|
||||
rb_rand_bytes_int32(rng->get_int32, rnd, ptr, n);
|
||||
rng->get_bytes(rnd, ptr, n);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue