aboutsummaryrefslogtreecommitdiffstats
path: root/lib/base64.rb
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-10 00:58:47 +0000
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-10 00:58:47 +0000
commit298f719456b55ae88667da519e09505ceea79a27 (patch)
treed5c472bdc693512fbff8a11c37b8505ca7a4cb1a /lib/base64.rb
parent98133ed7142955f8b162c272ce16ed65286c9272 (diff)
downloadruby-298f719456b55ae88667da519e09505ceea79a27.tar.gz
Use `unpack1` instead of `unpack` and `first`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/base64.rb')
-rw-r--r--lib/base64.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/base64.rb b/lib/base64.rb
index 280df5a2bb..24f0b02966 100644
--- a/lib/base64.rb
+++ b/lib/base64.rb
@@ -56,7 +56,7 @@ module Base64
# 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
# 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+.