aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rss
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-10 00:35:43 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-10 00:35:43 +0000
commit677208d32de42da65befd49b1815cfe6ae6a3231 (patch)
tree8c930da6175825647fc2640a0ae0277a723333c6 /lib/rss
parent9fc3bc3c2e2f0cd566c3519c32121565df4df33a (diff)
downloadruby-677208d32de42da65befd49b1815cfe6ae6a3231.tar.gz
stdlib: avoid extra calls to eliminate "\n" from Base64
We may use the '0' (zero) to avoid adding the line feed. Furthermore, the '*' (asterisk) modifier is not needed for a single-element arrays. * ext/psych/lib/psych/visitors/yaml_tree.rb (visit_String): eliminate chomp * lib/net/http.rb (connect): eliminate delete * lib/net/http/header.rb (basic_encode): ditto * lib/net/imap.rb (authenticate): eliminate gsub (self.encode_utf7): shorten delete arg * lib/net/smtp.rb (base64_encode): eliminate gsub * lib/open-uri.rb (OpenURI.open_http): eliminate delete * lib/rss/rss.rb: ditto * lib/securerandom.rb (base64): ditto (urlsafe_base64): eliminate delete! * lib/webrick/httpauth/digestauth.rb (split_param_value): eliminate chop * lib/webrick/httpproxy.rb (do_CONNECT): eliminate delete (setup_upstream_proxy_authentication): ditto [ruby-core:72666] [Feature #11938] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rss')
-rw-r--r--lib/rss/rss.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rss/rss.rb b/lib/rss/rss.rb
index 1bb0f6e826..5b9c5d4745 100644
--- a/lib/rss/rss.rb
+++ b/lib/rss/rss.rb
@@ -1241,7 +1241,7 @@ EOC
__send__(self.class.xml_getter).to_s
else
_content = content
- _content = [_content].pack("m").delete("\n") if need_base64_encode?
+ _content = [_content].pack("m0") if need_base64_encode?
h(_content)
end
end