[v3,1/2] Remove unnecessary if in __secs_to_tm

Submitted by Mattias Andrée on Feb. 28, 2021, 7:27 p.m.

Details

Message ID 20210228192712.1666688-1-maandree@kth.se
State New
Series "Remove unnecessary if in __secs_to_tm"
Headers show

Commit Message

Mattias Andrée Feb. 28, 2021, 7:27 p.m.
Since years divisible by 100 but not by 400 are not leap years,
q_cycles can at most be 24 (DAYS_PER_100Y / DAYS_PER_4Y == 24).
---
 src/time/__secs_to_tm.c | 1 -
 1 file changed, 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/time/__secs_to_tm.c b/src/time/__secs_to_tm.c
index 093d9021..62219df5 100644
--- a/src/time/__secs_to_tm.c
+++ b/src/time/__secs_to_tm.c
@@ -44,7 +44,6 @@  int __secs_to_tm(long long t, struct tm *tm)
 	remdays -= c_cycles * DAYS_PER_100Y;
 
 	q_cycles = remdays / DAYS_PER_4Y;
-	if (q_cycles == 25) q_cycles--;
 	remdays -= q_cycles * DAYS_PER_4Y;
 
 	remyears = remdays / 365;