[前][次][番号順一覧][スレッド一覧]

ruby-changes:41925

From: nobu <ko1@a...>
Date: Fri, 4 Mar 2016 22:39:50 +0900 (JST)
Subject: [ruby-changes:41925] nobu:r53999 (trunk): securerandom.rb: remove to_s call

nobu	2016-03-04 22:39:46 +0900 (Fri, 04 Mar 2016)

  New Revision: 53999

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53999

  Log:
    securerandom.rb: remove to_s call
    
    * lib/securerandom.rb (gen_random): Array#join returns a String,
      no to_s is needed.

  Modified files:
    trunk/lib/securerandom.rb
Index: lib/securerandom.rb
===================================================================
--- lib/securerandom.rb	(revision 53998)
+++ lib/securerandom.rb	(revision 53999)
@@ -54,8 +54,7 @@ module SecureRandom https://github.com/ruby/ruby/blob/trunk/lib/securerandom.rb#L54
       pid = $$
       unless @pid == pid
         now = Process.clock_gettime(Process::CLOCK_REALTIME, :nanosecond)
-        ary = [now, @pid, pid]
-        OpenSSL::Random.random_add(ary.join("").to_s, 0.0)
+        OpenSSL::Random.random_add([now, @pid, pid].join(""), 0.0)
         seed = Random.raw_seed(16)
         if (seed)
           OpenSSL::Random.random_add(seed, 16)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]