summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-12-30 17:31:32 +0100
committerCarl Hetherington <cth@carlh.net>2022-12-30 17:31:32 +0100
commit5b3a20274b3c3c05825a153580aae6a16feecb7d (patch)
treeda156b250bb33b7cd4f99527c3498000f4535200 /src
parentce50486bd2af2a0875f02771dd202f9dd45fc599 (diff)
Fix some embarassing bugs in dcp::LocalTime comparisons.
Diffstat (limited to 'src')
-rw-r--r--src/local_time.cc8
1 files changed, 7 insertions, 1 deletions
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;
}