Chromium Code Reviews| Index: net/cert/signed_tree_head.cc |
| diff --git a/net/cert/signed_tree_head.cc b/net/cert/signed_tree_head.cc |
| index 8bf2b9f3ff7755fae4e6082f1f7528fbd166dafe..8ae617680a95db1ddb16561114241875e006a73d 100644 |
| --- a/net/cert/signed_tree_head.cc |
| +++ b/net/cert/signed_tree_head.cc |
| @@ -45,5 +45,20 @@ void PrintTo(const SignedTreeHead& sth, std::ostream* os) { |
| << "}"; |
| } |
| +bool operator==(const SignedTreeHead& lhs, const SignedTreeHead& rhs) { |
| + return lhs.version == rhs.version && lhs.timestamp == rhs.timestamp && |
| + lhs.tree_size == rhs.tree_size && lhs.log_id == rhs.log_id && |
|
Ryan Sleevi
2016/05/17 22:20:16
fwiw, you could use
return std::tie(lhs.version,
Eran Messeri
2016/05/18 10:37:20
Done - switched to using std::tie and removed the
|
| + (memcmp(lhs.sha256_root_hash, rhs.sha256_root_hash, |
| + kSthRootHashLength) == 0) && |
| + (lhs.signature.SignatureParametersMatch( |
| + rhs.signature.hash_algorithm, |
| + rhs.signature.signature_algorithm)) && |
| + lhs.signature.signature_data == rhs.signature.signature_data; |
| +} |
| + |
| +bool operator!=(const SignedTreeHead& lhs, const SignedTreeHead& rhs) { |
| + return !operator==(lhs, rhs); |
|
Ryan Sleevi
2016/05/17 22:20:16
!(lhs == rhs)
No need to directly invoke operator
Eran Messeri
2016/05/18 10:37:20
Done.
|
| +} |
| + |
| } // namespace ct |
| } // namespace net |