diff options
| author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-12 06:18:06 +0000 |
|---|---|---|
| committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-02-12 06:18:06 +0000 |
| commit | 5aa55903a6c20a0989723bf2f84f8932da3a85e4 (patch) | |
| tree | d0af630d5a983259de0edc350507d3789256a160 /lib/date | |
| parent | 55b1327d1b1ab126eca4bdf52ee817f08357530d (diff) | |
| download | ruby-5aa55903a6c20a0989723bf2f84f8932da3a85e4.tar.gz ruby-5aa55903a6c20a0989723bf2f84f8932da3a85e4.tar.xz ruby-5aa55903a6c20a0989723bf2f84f8932da3a85e4.zip | |
* ext/json/lib/json/pure/generator.rb,
ext/json/lib/json/pure/parser.rb, ext/openssl/lib/openssl/x509.rb,
ext/win32ole/sample/olegen.rb, lib/date/format.rb, lib/irb/context.rb,
lib/irb/workspace.rb, lib/net/http.rb, lib/net/imap.rb,
lib/rdoc/generator.rb, lib/rdoc/markup/to_html.rb,
lib/rdoc/markup/to_latex.rb, lib/rdoc/parsers/parse_c.rb,
lib/rdoc/ri/formatter.rb, lib/rexml/parsers/baseparser.rb,
lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rss/parser.rb,
lib/uri/common.rb, lib/uri/generic.rb, lib/webrick/httpresponse.rb,
lib/webrick/httpservlet/filehandler.rb, lib/yaml/baseemitter.rb,
lib/yaml/encoding.rb: performance tuning arround String#gsub.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/date')
| -rw-r--r-- | lib/date/format.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/date/format.rb b/lib/date/format.rb index 3b152b65b..46d2147b8 100644 --- a/lib/date/format.rb +++ b/lib/date/format.rb @@ -215,9 +215,9 @@ class Date :emit_a, :emit_ad, :emit_au def strftime(fmt='%F') - fmt.gsub(/%([-_0^#]+)?(\d+)?([EO]?(?::{1,3}z|.))/m) do |m| + fmt.gsub(/%([-_0^#]+)?(\d+)?([EO]?(?::{1,3}z|.))/m) do f = {} - a = $& + m = $& s, w, c = $1, $2, $3 if s s.scan(/./) do |k| @@ -327,7 +327,7 @@ class Date when '%'; emit_a('%', 0, f) when '+'; emit_a(strftime('%a %b %e %H:%M:%S %Z %Y'), 0, f) else - a + m end end end |
