diff options
author | Rosen Penev | 2020-06-07 21:48:10 -0700 |
---|---|---|
committer | Nikias Bassen | 2020-11-24 01:06:31 +0100 |
commit | 9f60cdd76b6044931cc2f2b6f2fbec3deb67a425 (patch) | |
tree | 66c1a3c42769535966367c3f6f10881da2673f33 /src/time64.c | |
parent | 2899553df92cd4e10590da73ae7375e5b5517d45 (diff) | |
download | libplist-9f60cdd76b6044931cc2f2b6f2fbec3deb67a425.tar.gz libplist-9f60cdd76b6044931cc2f2b6f2fbec3deb67a425.tar.bz2 |
Improve code readability by not using else after return
[clang-tidy] Found with readability-else-after-return
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'src/time64.c')
-rw-r--r-- | src/time64.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/time64.c b/src/time64.c index db571d8..364e159 100644 --- a/src/time64.c +++ b/src/time64.c @@ -176,34 +176,28 @@ static int is_exception_century(Year year) static int cmp_date( const struct TM* left, const struct tm* right ) { if( left->tm_year > right->tm_year ) return 1; - else if( left->tm_year < right->tm_year ) + if( left->tm_year < right->tm_year ) return -1; - if( left->tm_mon > right->tm_mon ) return 1; - else if( left->tm_mon < right->tm_mon ) + if( left->tm_mon < right->tm_mon ) return -1; - if( left->tm_mday > right->tm_mday ) return 1; - else if( left->tm_mday < right->tm_mday ) + if( left->tm_mday < right->tm_mday ) return -1; - if( left->tm_hour > right->tm_hour ) return 1; - else if( left->tm_hour < right->tm_hour ) + if( left->tm_hour < right->tm_hour ) return -1; - if( left->tm_min > right->tm_min ) return 1; - else if( left->tm_min < right->tm_min ) + if( left->tm_min < right->tm_min ) return -1; - if( left->tm_sec > right->tm_sec ) return 1; - else if( left->tm_sec < right->tm_sec ) + if( left->tm_sec < right->tm_sec ) return -1; - return 0; } @@ -774,15 +768,15 @@ struct TM *localtime64_r (const Time64_T *timev, struct TM *local_tm) static int valid_tm_wday( const struct TM* date ) { if( 0 <= date->tm_wday && date->tm_wday <= 6 ) return 1; - else - return 0; + + return 0; } static int valid_tm_mon( const struct TM* date ) { if( 0 <= date->tm_mon && date->tm_mon <= 11 ) return 1; - else - return 0; + + return 0; } |