[前][次][番号順一覧][スレッド一覧]

ruby-changes:16558

From: tenderlove <ko1@a...>
Date: Tue, 6 Jul 2010 03:14:49 +0900 (JST)
Subject: [ruby-changes:16558] Ruby:r28550 (trunk): * ext/psych/lib/psych/scalar_scanner.rb: making the code more beautiful.

tenderlove	2010-07-06 03:14:37 +0900 (Tue, 06 Jul 2010)

  New Revision: 28550

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28550

  Log:
    * ext/psych/lib/psych/scalar_scanner.rb: making the code more beautiful.
      Thanks nobu!

  Modified files:
    trunk/ext/psych/lib/psych/scalar_scanner.rb

Index: ext/psych/lib/psych/scalar_scanner.rb
===================================================================
--- ext/psych/lib/psych/scalar_scanner.rb	(revision 28549)
+++ ext/psych/lib/psych/scalar_scanner.rb	(revision 28550)
@@ -90,7 +90,7 @@
       return time if 'Z' == md[3]
       return Time.at(time.to_i, us) unless md[3]
 
-      tz = md[3].split(':').map { |digit| Integer(digit.sub(/([-+])0/, '\1')) }
+      tz = md[3].split(':').map { |digit| Integer(digit, 10) }
       offset = tz.first * 3600 + ((tz[1] || 0) * 60)
       Time.at((time - offset).to_i, us)
     end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]