1
0
Fork 0

@maierlars 😍 (#9394)

This commit is contained in:
Jan 2019-07-04 09:20:20 +02:00 committed by GitHub
parent 081e755b25
commit 5221dc98b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View File

@ -799,7 +799,9 @@ struct ObjectBuilder final : public BuilderContainer,
try {
builder->close();
} catch (...) {
// destructors must not throw
// destructors must not throw. however, we can at least
// signal something is very wrong in debug mode
VELOCYPACK_ASSERT(false);
}
}
};
@ -826,7 +828,9 @@ struct ArrayBuilder final : public BuilderContainer,
try {
builder->close();
} catch (...) {
// destructors must not throw
// destructors must not throw. however, we can at least
// signal something is very wrong in debug mode
VELOCYPACK_ASSERT(false);
}
}
};

View File

@ -534,10 +534,14 @@ class Slice {
}
// tests whether the Slice is an empty array
constexpr bool isEmptyArray() const noexcept { return head() == 0x01; }
bool isEmptyArray() const {
return isArray() && length() == 0;
}
// tests whether the Slice is an empty object
constexpr bool isEmptyObject() const noexcept { return head() == 0x0a; }
bool isEmptyObject() const {
return isObject() && length() == 0;
}
// translates an integer key into a string
Slice translate() const;