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

Unified Diff: net/der/input.cc

Issue 1664243002: Using == instead of Equals for der::Input comparison. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing missing !=. 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.cc
diff --git a/net/der/input.cc b/net/der/input.cc
index 871f9f4ec7dc29a52d645f9c2194c2795d559394..638adbdba975a22e166fb68b4debdaf6a835bc70 100644
--- a/net/der/input.cc
+++ b/net/der/input.cc
@@ -24,12 +24,16 @@ Input::Input(const base::StringPiece& in)
Input::Input(const std::string* s) : Input(base::StringPiece(*s)) {}
-bool Input::Equals(const Input& other) const {
+bool Input::operator==(const Input& other) const {
if (len_ != other.len_)
return false;
return memcmp(data_, other.data_, len_) == 0;
}
+bool Input::operator!=(const Input& other) const {
+ return !(*this == other);
+}
+
std::string Input::AsString() const {
return std::string(reinterpret_cast<const char*>(data_), len_);
}
« net/der/input.h ('K') | « net/der/input.h ('k') | net/der/input_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698