ruby-changes:52119
From: akr <ko1@a...>
Date: Mon, 13 Aug 2018 01:45:07 +0900 (JST)
Subject: [ruby-changes:52119] akr:r64327 (trunk): timegm_noleapsecond uses calc_tm_yday.
akr 2018-08-13 01:45:02 +0900 (Mon, 13 Aug 2018) New Revision: 64327 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64327 Log: timegm_noleapsecond uses calc_tm_yday. Modified files: trunk/time.c Index: time.c =================================================================== --- time.c (revision 64326) +++ time.c (revision 64327) @@ -2671,11 +2671,7 @@ static time_t https://github.com/ruby/ruby/blob/trunk/time.c#L2671 timegm_noleapsecond(struct tm *tm) { long tm_year = tm->tm_year; - int tm_yday = tm->tm_mday; - if (leap_year_p(tm_year + 1900)) - tm_yday += leap_year_yday_offset[tm->tm_mon]; - else - tm_yday += common_year_yday_offset[tm->tm_mon]; + int tm_yday = calc_tm_yday(tm->tm_year, tm->tm_mon, tm->tm_mday); /* * `Seconds Since the Epoch' in SUSv3: -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/