gmtime: avoid a modulus

since WEEK_SECONDS = 7 * DAY_SECONDS, the result is the same

Change-Id: Iec161fc2de626c99c1aabf80ab1d3243eac602d9
This commit is contained in:
Rafaël Carré 2012-03-11 17:20:35 -04:00 committed by Bertrik Sikken
parent 2004f3eae4
commit 24bd9d5393

View file

@ -53,7 +53,7 @@ struct tm *gmtime_r(const time_t *timep, struct tm *tm)
int year, i, mday, hour, min;
/* weekday */
tm->tm_wday = ((seconds % WEEK_SECONDS) / DAY_SECONDS + 4) % 7;
tm->tm_wday = (seconds / DAY_SECONDS + 4) % 7;
/* Year */
year = 1970;