mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Replaced nested if statement with boolean logic expression
This commit is contained in:
parent
8cf7888fd5
commit
96be49b78d
1 changed files with 5 additions and 9 deletions
14
src/Date.cpp
14
src/Date.cpp
|
@ -303,15 +303,11 @@ bool Date::leapYear (int year)
|
|||
{
|
||||
bool ly = false;
|
||||
|
||||
if (!(year % 4))
|
||||
{
|
||||
ly = true;
|
||||
if (!(year % 100))
|
||||
{
|
||||
ly = false;
|
||||
if (!(year % 400)) ly =true;
|
||||
}
|
||||
}
|
||||
// (year % 4 == 0) && (year % 100 !=0) OR
|
||||
// (year % 400 == 0)
|
||||
// are leapyears
|
||||
|
||||
if (((!(year % 4)) && (year % 100)) || (!(year % 400))) ly = true;
|
||||
|
||||
return ly;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue