summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-12 16:45:02 (GMT)
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-12 16:45:02 (GMT)
commit8507904385e86d4ce2c913e11e86ea5b71267fdc (patch)
tree6dbdb9e3f0163244d791c8958af48f1dcedd4a29 /time.c
parent25c79f446d8bccbb88b5ba98817054f5a12a8c47 (diff)
timegm_noleapsecond uses calc_tm_yday.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r--time.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/time.c b/time.c
index f6ce437..46f5d92 100644
--- a/time.c
+++ b/time.c
@@ -2671,11 +2671,7 @@ static time_t
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: