diff options
author | Mau Magnaguagno <maumagnaguagno@gmail.com> | 2023-08-31 03:38:45 -0300 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-09-06 19:24:53 +0900 |
commit | 60a6de81a823cdb932d21fa5869c93853d3f2795 (patch) | |
tree | 76a5a34d59ebaedb80d642ba065a9e1762f0bc2a /ext/openssl/lib/openssl/ssl.rb | |
parent | b6d7cdc2bad0eadbca73f3486917f0ec7a475814 (diff) |
[ruby/openssl] Prefer String#unpack1
(https://github.com/ruby/openssl/pull/586)
String#unpack1 avoids the intermediate array created by String#unpack
for single elements, while also making a call to Array#first/[0]
unnecessary.
https://github.com/ruby/openssl/commit/8eb0715a42
Diffstat (limited to 'ext/openssl/lib/openssl/ssl.rb')
-rw-r--r-- | ext/openssl/lib/openssl/ssl.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/openssl/lib/openssl/ssl.rb b/ext/openssl/lib/openssl/ssl.rb index 94be6ba80b..e557b8b483 100644 --- a/ext/openssl/lib/openssl/ssl.rb +++ b/ext/openssl/lib/openssl/ssl.rb @@ -494,7 +494,7 @@ ssbzSibBsu/6iGtCOGEoXJf//////////wIBAg== unless ctx.session_id_context # see #6137 - session id may not exceed 32 bytes prng = ::Random.new($0.hash) - session_id = prng.bytes(16).unpack('H*')[0] + session_id = prng.bytes(16).unpack1('H*') @ctx.session_id_context = session_id end @start_immediately = true |