|
|
@ -123,7 +123,7 @@ inline bool operator!=(const Slice& x, const Slice& y) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
inline int Slice::compare(const Slice& b) const { |
|
|
|
inline int Slice::compare(const Slice& b) const { |
|
|
|
const int min_len = (size_ < b.size_) ? size_ : b.size_; |
|
|
|
const size_t min_len = (size_ < b.size_) ? size_ : b.size_; |
|
|
|
int r = memcmp(data_, b.data_, min_len); |
|
|
|
int r = memcmp(data_, b.data_, min_len); |
|
|
|
if (r == 0) { |
|
|
|
if (r == 0) { |
|
|
|
if (size_ < b.size_) r = -1; |
|
|
|
if (size_ < b.size_) r = -1; |
|
|
|