ruby-changes:66583
From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Thu, 24 Jun 2021 12:48:34 +0900 (JST)
Subject: [ruby-changes:66583] 0fbdaaf7c9 (master): rand_bytes: prefer rng->get_bytes
https://git.ruby-lang.org/ruby.git/commit/?id=0fbdaaf7c9 From 0fbdaaf7c91dd2ad09da3107d92fdce24eb21d42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= <shyouhei@r...> Date: Thu, 24 Jun 2021 11:57:40 +0900 Subject: rand_bytes: prefer rng->get_bytes Because why not. There was no use case of rng->get_bytes before this changeset. --- random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/random.c b/random.c index a2f8157..0179646 100644 --- a/random.c +++ b/random.c @@ -1196,7 +1196,7 @@ rand_bytes(const rb_random_interface_t *rng, rb_random_t *rnd, long n) https://github.com/ruby/ruby/blob/trunk/random.c#L1196 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; } -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/