mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-15 07:06:11 -04:00
Fix build and tests
Signed-off-by: Alexey Polyudov <apolyudov@google.com> Change-Id: I3671e40fd0f8f028e3c8e46c4a47de0d2cc9aeff
This commit is contained in:
@@ -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_; }
|
||||
|
||||
Reference in New Issue
Block a user