ruby-changes:45514
From: kazu <ko1@a...>
Date: Fri, 10 Feb 2017 09:58:52 +0900 (JST)
Subject: [ruby-changes:45514] kazu:r57588 (trunk): Use `unpack1` instead of `unpack` and `first`
kazu 2017-02-10 09:58:47 +0900 (Fri, 10 Feb 2017) New Revision: 57588 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57588 Log: Use `unpack1` instead of `unpack` and `first` Modified files: trunk/lib/base64.rb Index: lib/base64.rb =================================================================== --- lib/base64.rb (revision 57587) +++ lib/base64.rb (revision 57588) @@ -56,7 +56,7 @@ module Base64 https://github.com/ruby/ruby/blob/trunk/lib/base64.rb#L56 # This is line three # And so on... def decode64(str) - str.unpack("m").first + str.unpack1("m") end # Returns the Base64-encoded version of +bin+. @@ -71,7 +71,7 @@ module Base64 https://github.com/ruby/ruby/blob/trunk/lib/base64.rb#L71 # ArgumentError is raised if +str+ is incorrectly padded or contains # non-alphabet characters. Note that CR or LF are also rejected. def strict_decode64(str) - str.unpack("m0").first + str.unpack1("m0") end # Returns the Base64-encoded version of +bin+. -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/