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;
|
bool ly = false;
|
||||||
|
|
||||||
if (!(year % 4))
|
// (year % 4 == 0) && (year % 100 !=0) OR
|
||||||
{
|
// (year % 400 == 0)
|
||||||
ly = true;
|
// are leapyears
|
||||||
if (!(year % 100))
|
|
||||||
{
|
if (((!(year % 4)) && (year % 100)) || (!(year % 400))) ly = true;
|
||||||
ly = false;
|
|
||||||
if (!(year % 400)) ly =true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ly;
|
return ly;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue