mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 23:55:40 +00:00
Merge pull request #565 from lioncash/stamp
timestamp: Correct duplicate conditionals
This commit is contained in:
commit
2cfb811569
|
@ -216,11 +216,7 @@ bool Timestamp::operator==(const Timestamp& other) const
|
|||
|
||||
bool Timestamp::operator!=(const Timestamp& other) const
|
||||
{
|
||||
#if defined(WIN32)
|
||||
return std::memcmp(&m_value, &other.m_value, sizeof(m_value)) != 0;
|
||||
#else
|
||||
return std::memcmp(&m_value, &other.m_value, sizeof(m_value)) != 0;
|
||||
#endif
|
||||
return !operator==(other);
|
||||
}
|
||||
|
||||
bool Timestamp::operator<(const Timestamp& other) const
|
||||
|
@ -252,16 +248,16 @@ bool Timestamp::operator<(const Timestamp& other) const
|
|||
else if (m_value.wMinute < other.m_value.wMinute)
|
||||
return true;
|
||||
|
||||
if (m_value.wHour > other.m_value.wHour)
|
||||
return false;
|
||||
else if (m_value.wHour < other.m_value.wHour)
|
||||
return true;
|
||||
|
||||
if (m_value.wSecond > other.m_value.wSecond)
|
||||
return false;
|
||||
else if (m_value.wSecond < other.m_value.wSecond)
|
||||
return true;
|
||||
|
||||
if (m_value.wMilliseconds > other.m_value.wMilliseconds)
|
||||
return false;
|
||||
else if (m_value.wMilliseconds < other.m_value.wMilliseconds)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
#else
|
||||
|
@ -310,16 +306,16 @@ bool Timestamp::operator<=(const Timestamp& other) const
|
|||
else if (m_value.wMinute < other.m_value.wMinute)
|
||||
return true;
|
||||
|
||||
if (m_value.wHour > other.m_value.wHour)
|
||||
return false;
|
||||
else if (m_value.wHour < other.m_value.wHour)
|
||||
return true;
|
||||
|
||||
if (m_value.wSecond > other.m_value.wSecond)
|
||||
return false;
|
||||
else if (m_value.wSecond <= other.m_value.wSecond)
|
||||
return true;
|
||||
|
||||
if (m_value.wMilliseconds > other.m_value.wMilliseconds)
|
||||
return false;
|
||||
else if (m_value.wMilliseconds < other.m_value.wMilliseconds)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
#else
|
||||
|
@ -368,16 +364,16 @@ bool Timestamp::operator>(const Timestamp& other) const
|
|||
else if (m_value.wMinute > other.m_value.wMinute)
|
||||
return true;
|
||||
|
||||
if (m_value.wHour < other.m_value.wHour)
|
||||
return false;
|
||||
else if (m_value.wHour > other.m_value.wHour)
|
||||
return true;
|
||||
|
||||
if (m_value.wSecond < other.m_value.wSecond)
|
||||
return false;
|
||||
else if (m_value.wSecond > other.m_value.wSecond)
|
||||
return true;
|
||||
|
||||
if (m_value.wMilliseconds < other.m_value.wMilliseconds)
|
||||
return false;
|
||||
else if (m_value.wMilliseconds > other.m_value.wMilliseconds)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
#else
|
||||
|
@ -426,16 +422,16 @@ bool Timestamp::operator>=(const Timestamp& other) const
|
|||
else if (m_value.wMinute > other.m_value.wMinute)
|
||||
return true;
|
||||
|
||||
if (m_value.wHour < other.m_value.wHour)
|
||||
return false;
|
||||
else if (m_value.wHour > other.m_value.wHour)
|
||||
return true;
|
||||
|
||||
if (m_value.wSecond < other.m_value.wSecond)
|
||||
return false;
|
||||
else if (m_value.wSecond >= other.m_value.wSecond)
|
||||
return true;
|
||||
|
||||
if (m_value.wMilliseconds < other.m_value.wMilliseconds)
|
||||
return false;
|
||||
else if (m_value.wMilliseconds > other.m_value.wMilliseconds)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue