From 5b3a20274b3c3c05825a153580aae6a16feecb7d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 30 Dec 2022 17:31:32 +0100 Subject: Fix some embarassing bugs in dcp::LocalTime comparisons. --- src/local_time.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/local_time.cc') diff --git a/src/local_time.cc b/src/local_time.cc index 727583e5..f60fb0a6 100644 --- a/src/local_time.cc +++ b/src/local_time.cc @@ -273,7 +273,7 @@ bool LocalTime::operator== (LocalTime const & other) const { return _year == other._year && _month == other._month && _day == other._day && - _hour == other._hour && _second == other._second && _millisecond == other._millisecond && + _hour == other._hour && _minute == other._minute && _second == other._second && _millisecond == other._millisecond && _offset == other._offset; } @@ -295,6 +295,9 @@ LocalTime::operator< (LocalTime const & other) const if (_hour != other._hour) { return _hour < other._hour; } + if (_minute != other._minute) { + return _minute < other._minute; + } if (_second != other._second) { return _second < other._second; } @@ -319,6 +322,9 @@ LocalTime::operator>(LocalTime const & other) const if (_hour != other._hour) { return _hour > other._hour; } + if (_minute != other._minute) { + return _minute > other._minute; + } if (_second != other._second) { return _second > other._second; } -- cgit v1.2.3