Modernize equality operators
This CL is pure clean-up and contains no functionality changes. Depending on the files covered in the CL (since the CL was generated using git cl split), it does a subset of the following: - Remove unneeded operator!= declarations/definitions since C++20 can automatically derive those from operator==. - Default operator== where this is equivalent to the current behavior. - Default operator<=> where this is equivalent to the current behavior. This CL was uploaded by git cl split. R=xiyuan@chromium.org Bug: 40256175 Change-Id: I08c92e6e2d83225cf6dc87e549cab9ce0c113553 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6512944 Commit-Queue: Xiyuan Xia <xiyuan@chromium.org> Auto-Submit: Jan Keitel <jkeitel@google.com> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org> Cr-Commit-Position: refs/heads/main@{#1456411}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
2c38aa1d5e
commit
5faf0899a8
components/account_id
@ -83,10 +83,6 @@ bool AccountId::operator==(const AccountId& other) const {
|
||||
}
|
||||
}
|
||||
|
||||
bool AccountId::operator!=(const AccountId& other) const {
|
||||
return !operator==(other);
|
||||
}
|
||||
|
||||
bool AccountId::operator<(const AccountId& right) const {
|
||||
// TODO(alemate): update this once all AccountId members are filled.
|
||||
return user_email_ < right.user_email_;
|
||||
|
@ -47,7 +47,6 @@ class COMPONENT_EXPORT(COMPONENTS_ACCOUNT_ID) AccountId {
|
||||
// If both are not UNKNOWN and not equal then it returns false.
|
||||
// If AccountType == GOOGLE then it checks if either ids or emails are equal.
|
||||
bool operator==(const AccountId& other) const;
|
||||
bool operator!=(const AccountId& other) const;
|
||||
bool operator<(const AccountId& right) const;
|
||||
|
||||
bool empty() const;
|
||||
|
Reference in New Issue
Block a user