gmtime: avoid a modulus
since WEEK_SECONDS = 7 * DAY_SECONDS, the result is the same Change-Id: Iec161fc2de626c99c1aabf80ab1d3243eac602d9
This commit is contained in:
parent
2004f3eae4
commit
24bd9d5393
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue