[ruby-cvs:60651] normal:r53488 (trunk): stdlib: avoid extra calls to eliminate "\n" from Base64

normal at ruby-lang.org normal at ruby-lang.org
Sun Jan 10 09:35:43 JST 2016


normal	2016-01-10 09:35:43 +0900 (Sun, 10 Jan 2016)

  New Revision: 53488

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

  Log:
    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]

  Modified files:
    trunk/ChangeLog
    trunk/ext/psych/lib/psych/visitors/yaml_tree.rb
    trunk/lib/net/http/header.rb
    trunk/lib/net/http.rb
    trunk/lib/net/imap.rb
    trunk/lib/net/smtp.rb
    trunk/lib/open-uri.rb
    trunk/lib/rss/rss.rb
    trunk/lib/securerandom.rb
    trunk/lib/webrick/httpauth/digestauth.rb
    trunk/lib/webrick/httpproxy.rb


More information about the ruby-cvs mailing list