| Index: net/der/input.cc
|
| diff --git a/net/der/input.cc b/net/der/input.cc
|
| index 871f9f4ec7dc29a52d645f9c2194c2795d559394..49955905fa2d1f3db570b8badb4362dab5763330 100644
|
| --- a/net/der/input.cc
|
| +++ b/net/der/input.cc
|
| @@ -24,12 +24,6 @@ Input::Input(const base::StringPiece& in)
|
|
|
| Input::Input(const std::string* s) : Input(base::StringPiece(*s)) {}
|
|
|
| -bool Input::Equals(const Input& other) const {
|
| - if (len_ != other.len_)
|
| - return false;
|
| - return memcmp(data_, other.data_, len_) == 0;
|
| -}
|
| -
|
| std::string Input::AsString() const {
|
| return std::string(reinterpret_cast<const char*>(data_), len_);
|
| }
|
| @@ -38,6 +32,16 @@ base::StringPiece Input::AsStringPiece() const {
|
| return base::StringPiece(reinterpret_cast<const char*>(data_), len_);
|
| }
|
|
|
| +bool operator==(const Input& lhs, const Input& rhs) {
|
| + if (lhs.Length() != rhs.Length())
|
| + return false;
|
| + return memcmp(lhs.UnsafeData(), rhs.UnsafeData(), lhs.Length()) == 0;
|
| +}
|
| +
|
| +bool operator!=(const Input& lhs, const Input& rhs) {
|
| + return !(lhs == rhs);
|
| +}
|
| +
|
| bool operator<(const Input& lhs, const Input& rhs) {
|
| return std::lexicographical_compare(
|
| lhs.UnsafeData(), lhs.UnsafeData() + lhs.Length(), rhs.UnsafeData(),
|
|
|