mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Performance improvements:
- Added parse-free convenience functions
This commit is contained in:
parent
53d829cfc1
commit
873376c287
6 changed files with 61 additions and 25 deletions
20
src/Date.cpp
20
src/Date.cpp
|
@ -602,43 +602,43 @@ int Date::second () const
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Date::operator== (const Date& rhs)
|
||||
bool Date::operator== (const Date& rhs) const
|
||||
{
|
||||
return rhs._t == _t;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Date::operator!= (const Date& rhs)
|
||||
bool Date::operator!= (const Date& rhs) const
|
||||
{
|
||||
return rhs._t != _t;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Date::operator< (const Date& rhs)
|
||||
bool Date::operator< (const Date& rhs) const
|
||||
{
|
||||
return _t < rhs._t;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Date::operator> (const Date& rhs)
|
||||
bool Date::operator> (const Date& rhs) const
|
||||
{
|
||||
return _t > rhs._t;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Date::operator<= (const Date& rhs)
|
||||
bool Date::operator<= (const Date& rhs) const
|
||||
{
|
||||
return _t <= rhs._t;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Date::operator>= (const Date& rhs)
|
||||
bool Date::operator>= (const Date& rhs) const
|
||||
{
|
||||
return _t >= rhs._t;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Date::sameHour (const Date& rhs)
|
||||
bool Date::sameHour (const Date& rhs) const
|
||||
{
|
||||
if (this->year () == rhs.year () &&
|
||||
this->month () == rhs.month () &&
|
||||
|
@ -650,7 +650,7 @@ bool Date::sameHour (const Date& rhs)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Date::sameDay (const Date& rhs)
|
||||
bool Date::sameDay (const Date& rhs) const
|
||||
{
|
||||
if (this->year () == rhs.year () &&
|
||||
this->month () == rhs.month () &&
|
||||
|
@ -661,7 +661,7 @@ bool Date::sameDay (const Date& rhs)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Date::sameMonth (const Date& rhs)
|
||||
bool Date::sameMonth (const Date& rhs) const
|
||||
{
|
||||
if (this->year () == rhs.year () &&
|
||||
this->month () == rhs.month ())
|
||||
|
@ -671,7 +671,7 @@ bool Date::sameMonth (const Date& rhs)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Date::sameYear (const Date& rhs)
|
||||
bool Date::sameYear (const Date& rhs) const
|
||||
{
|
||||
if (this->year () == rhs.year ())
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue