summaryrefslogtreecommitdiff
path: root/src/verify.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-12-26 00:32:55 +0100
committerCarl Hetherington <cth@carlh.net>2023-12-26 00:32:55 +0100
commit07314aa75683a7d6d34069514a8bb377bd2def77 (patch)
tree6b4146922870180af6289476caf44f260932ca10 /src/verify.cc
parentad4f5b4873782d7808d505e2946338fb116544b4 (diff)
Fix operator== to take everything in VerificationNote into account.
Diffstat (limited to 'src/verify.cc')
-rw-r--r--src/verify.cc33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/verify.cc b/src/verify.cc
index 960f0438..c5abb857 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -2124,7 +2124,16 @@ dcp::note_to_string (VerificationNote note)
bool
dcp::operator== (dcp::VerificationNote const& a, dcp::VerificationNote const& b)
{
- return a.type() == b.type() && a.code() == b.code() && a.note() == b.note() && a.file() == b.file() && a.line() == b.line();
+ return a.type() == b.type() &&
+ a.code() == b.code() &&
+ a.note() == b.note() &&
+ a.file() == b.file() &&
+ a.line() == b.line() &&
+ a.frame() == b.frame() &&
+ a.component() == b.component() &&
+ a.size() == b.size() &&
+ a.id() == b.id() &&
+ a.other_id() == b.other_id();
}
@@ -2147,7 +2156,27 @@ dcp::operator< (dcp::VerificationNote const& a, dcp::VerificationNote const& b)
return a.file().get_value_or("") < b.file().get_value_or("");
}
- return a.line().get_value_or(0) < b.line().get_value_or(0);
+ if (a.line() != b.line()) {
+ return a.line().get_value_or(0) < b.line().get_value_or(0);
+ }
+
+ if (a.frame() != b.frame()) {
+ return a.frame().get_value_or(0) < b.frame().get_value_or(0);
+ }
+
+ if (a.component() != b.component()) {
+ return a.component().get_value_or(0) < b.component().get_value_or(0);
+ }
+
+ if (a.size() != b.size()) {
+ return a.size().get_value_or(0) < b.size().get_value_or(0);
+ }
+
+ if (a.id() != b.id()) {
+ return a.id().get_value_or("") < b.id().get_value_or("");
+ }
+
+ return a.other_id().get_value_or("") < b.other_id().get_value_or("");
}