[modularize] Use std::tie to implement operator< (NFC) (#146220)

std::tie clearly expresses the intent while slightly shortening the
code.
This commit is contained in:
Kazu Hirata
2025-06-28 13:04:00 -07:00
committed by GitHub
parent dea8217a7a
commit 402baea0a9

View File

@@ -459,7 +459,7 @@ struct HeaderEntry {
return !(X == Y);
}
friend bool operator<(const HeaderEntry &X, const HeaderEntry &Y) {
return X.Loc < Y.Loc || (X.Loc == Y.Loc && X.Name < Y.Name);
return std::tie(X.Loc, X.Name) < std::tie(Y.Loc, Y.Name);
}
friend bool operator>(const HeaderEntry &X, const HeaderEntry &Y) {
return Y < X;