Fix build and tests

Signed-off-by: Alexey Polyudov <apolyudov@google.com>
Change-Id: I3671e40fd0f8f028e3c8e46c4a47de0d2cc9aeff
This commit is contained in:
Alexey Polyudov
2020-04-04 12:55:06 -07:00
parent a067c89eca
commit 18c09c5abe
15 changed files with 46 additions and 29 deletions
+2 -6
View File
@@ -43,15 +43,11 @@ class ByteArray {
// Operator overloads when comparing ConstPtr<ByteArray>.
bool operator==(const ByteArray& rhs) const {
return this->size() == rhs.size() &&
memcmp(this->getData(), rhs.getData(), this->size()) == 0;
return this->data_ == rhs.data_;
}
bool operator!=(const ByteArray& rhs) const { return !(*this == rhs); }
bool operator<(const ByteArray& rhs) const {
if (this->size() != rhs.size()) {
return this->size() < rhs.size();
}
return memcmp(this->getData(), rhs.getData(), this->size()) < 0;
return this->data_ < rhs.data_;
}
// TODO(b/149869249) : rename according to go/c-style
std::string asString() const { return data_; }