From 4c82705e34651d35e8cf5e303f3ebbc5a75f6670 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 23 Jun 2020 06:24:04 -0400 Subject: [PATCH] timestamp: Correct duplicate conditionals Previously, the milliseconds field wasn't being used in comparisons on Windows. --- src/common/timestamp.cpp | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/common/timestamp.cpp b/src/common/timestamp.cpp index 45e9e55b8..d980a6585 100644 --- a/src/common/timestamp.cpp +++ b/src/common/timestamp.cpp @@ -248,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 @@ -306,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 @@ -364,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 @@ -422,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