mirror of https://gitee.com/bigwinds/arangodb
updated vpack library
This commit is contained in:
parent
14bd7bbe72
commit
0038ccefb0
|
@ -732,7 +732,21 @@ class Slice {
|
|||
bool isEqualString(std::string const& attribute) const;
|
||||
|
||||
// check if two Slices are equal on the binary level
|
||||
bool equals(Slice const& other) const;
|
||||
bool equals(Slice const& other) const {
|
||||
if (head() != other.head()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ValueLength const size = byteSize();
|
||||
|
||||
if (size != other.byteSize()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (memcmp(start(), other.start(),
|
||||
arangodb::velocypack::checkOverflow(size)) == 0);
|
||||
}
|
||||
|
||||
bool operator==(Slice const& other) const { return equals(other); }
|
||||
bool operator!=(Slice const& other) const { return !equals(other); }
|
||||
|
||||
|
|
|
@ -390,22 +390,6 @@ Slice Slice::translateUnchecked() const {
|
|||
return Slice();
|
||||
}
|
||||
|
||||
// check if two Slices are equal on the binary level
|
||||
bool Slice::equals(Slice const& other) const {
|
||||
if (head() != other.head()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ValueLength const size = byteSize();
|
||||
|
||||
if (size != other.byteSize()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (memcmp(start(), other.start(),
|
||||
arangodb::velocypack::checkOverflow(size)) == 0);
|
||||
}
|
||||
|
||||
std::string Slice::toJson(Options const* options) const {
|
||||
std::string buffer;
|
||||
StringSink sink(&buffer);
|
||||
|
|
Loading…
Reference in New Issue