Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1773)

Unified Diff: net/der/input.h

Issue 1664243002: Using == instead of Equals for der::Input comparison. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Using non-class equality. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/der/input.h
diff --git a/net/der/input.h b/net/der/input.h
index 9c3f5ca87a4ab47a7ced6ecf712a947ad5ab382a..121a9e0770a949c077bd5e6047a37b7b39c5dd2c 100644
--- a/net/der/input.h
+++ b/net/der/input.h
@@ -63,9 +63,6 @@ class NET_EXPORT_PRIVATE Input {
// Returns the length in bytes of an Input's data.
size_t Length() const { return len_; }
- // Return true if the Input's data and |other|'s data are byte-wise equal.
- bool Equals(const Input& other) const;
-
// Returns a pointer to the Input's data. This method is marked as "unsafe"
// because access to the Input's data should be done through ByteReader
// instead. This method should only be used where using a ByteReader truly
@@ -91,6 +88,12 @@ class NET_EXPORT_PRIVATE Input {
size_t len_;
};
+// Return true if |lhs|'s data and |rhs|'s data are byte-wise equal.
+NET_EXPORT_PRIVATE bool operator==(const Input& lhs, const Input& rhs);
eroman 2016/02/04 19:43:42 Any reason to choose a function rather than method
mattm 2016/02/04 20:05:51 See my reference above to the style guide. (I don'
+
+// Return true if |lhs|'s data and |rhs|'s data are not byte-wise equal.
+NET_EXPORT_PRIVATE bool operator!=(const Input& lhs, const Input& rhs);
+
// Returns true if |lhs|'s data is lexicographically less than |rhs|'s data.
NET_EXPORT_PRIVATE bool operator<(const Input& lhs, const Input& rhs);

Powered by Google App Engine
This is Rietveld 408576698