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

ruby-changes:12976

From: akr <ko1@a...>
Date: Sun, 30 Aug 2009 23:46:53 +0900 (JST)
Subject: [ruby-changes:12976] Ruby:r24718 (trunk): * time.c (find_time_t): use mktime for the first guess.

akr	2009-08-30 23:44:54 +0900 (Sun, 30 Aug 2009)

  New Revision: 24718

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

  Log:
    * time.c (find_time_t): use mktime for the first guess.

  Modified files:
    trunk/ChangeLog
    trunk/time.c

Index: time.c
===================================================================
--- time.c	(revision 24717)
+++ time.c	(revision 24718)
@@ -1962,7 +1962,17 @@
 
     find_dst = 0 < tptr->tm_isdst;
 
+#if defined(HAVE_MKTIME)
     tm0 = *tptr;
+    if (!utc_p && (guess = mktime(&tm0)) != -1) {
+        tm = GUESS(&guess);
+        if (tm && tmcmp(tptr, tm) == 0) {
+            goto found;
+        }
+    }
+#endif
+
+    tm0 = *tptr;
     if (tm0.tm_mon < 0) {
       tm0.tm_mon = 0;
       tm0.tm_mday = 1;
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 24717)
+++ ChangeLog	(revision 24718)
@@ -1,3 +1,7 @@
+Sun Aug 30 23:44:09 2009  Tanaka Akira  <akr@f...>
+
+	* time.c (find_time_t): use mktime for the first guess.
+
 Sun Aug 30 16:38:56 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (rb_enc_symname2_p): not depend on nul terminator.

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

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