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 /test/openssl/test_digest.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 'test/openssl/test_digest.rb')
-rw-r--r-- | test/openssl/test_digest.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/openssl/test_digest.rb b/test/openssl/test_digest.rb index 84c128c12f..b0b5b9bed1 100644 --- a/test/openssl/test_digest.rb +++ b/test/openssl/test_digest.rb @@ -67,7 +67,7 @@ class OpenSSL::TestDigest < OpenSSL::TestCase end def encode16(str) - str.unpack("H*").first + str.unpack1("H*") end def test_sha2 |