[PATCH] if-else for announce_period

From: Tianyin Xu <tixu_at_cs.ucsd.edu>
Date: Fri, 8 Feb 2013 01:07:38 -0800

It's not wrong but when I see the code I want to refine it since it looks
uncomfortable.

 680 if (Config.Announce.period > 0) {
 681 Config.onoff.announce = 1;
 682 } else if (Config.Announce.period < 1) {
 683 Config.Announce.period = 86400 * 365; /* one year */
 684 Config.onoff.announce = 0;
 685 }

Announce.period is with type "time_t" so it's an integer. The "else-if" is
"logically" superfluous because as long as the value <=0, it must be <1.

Best,
Tianyin

-- 
Tianyin XU,
http://cseweb.ucsd.edu/~tixu/

Received on Fri Feb 08 2013 - 09:07:50 MST

This archive was generated by hypermail 2.2.0 : Fri Feb 08 2013 - 12:00:07 MST