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

ruby-changes:47266

From: kazu <ko1@a...>
Date: Fri, 21 Jul 2017 08:34:09 +0900 (JST)
Subject: [ruby-changes:47266] kazu:r59381 (trunk): Use `unpack1` instead of `unpack` and `[0]`

kazu	2017-07-21 08:34:03 +0900 (Fri, 21 Jul 2017)

  New Revision: 59381

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

  Log:
    Use `unpack1` instead of `unpack` and `[0]`

  Modified files:
    trunk/lib/net/smtp.rb
Index: lib/net/smtp.rb
===================================================================
--- lib/net/smtp.rb	(revision 59380)
+++ lib/net/smtp.rb	(revision 59381)
@@ -1035,9 +1035,9 @@ module Net https://github.com/ruby/ruby/blob/trunk/lib/net/smtp.rb#L1035
       end
 
       # Creates a CRAM-MD5 challenge. You can view more information on CRAM-MD5
-      # on Wikipedia: http://en.wikipedia.org/wiki/CRAM-MD5
+      # on Wikipedia: https://en.wikipedia.org/wiki/CRAM-MD5
       def cram_md5_challenge
-        @string.split(/ /)[1].unpack('m')[0]
+        @string.split(/ /)[1].unpack1('m')
       end
 
       # Returns a hash of the human readable reply text in the response if it

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

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