From 5221dc98b95956e62a5055971f1bc83d03541f3f Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 4 Jul 2019 09:20:20 +0200 Subject: [PATCH] @maierlars :heart_eyes: (#9394) --- 3rdParty/velocypack/include/velocypack/Builder.h | 8 ++++++-- 3rdParty/velocypack/include/velocypack/Slice.h | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/3rdParty/velocypack/include/velocypack/Builder.h b/3rdParty/velocypack/include/velocypack/Builder.h index 21079fb1ac..a6fd2edbaa 100644 --- a/3rdParty/velocypack/include/velocypack/Builder.h +++ b/3rdParty/velocypack/include/velocypack/Builder.h @@ -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); } } }; diff --git a/3rdParty/velocypack/include/velocypack/Slice.h b/3rdParty/velocypack/include/velocypack/Slice.h index 0146bf9e32..43fb16a0b0 100644 --- a/3rdParty/velocypack/include/velocypack/Slice.h +++ b/3rdParty/velocypack/include/velocypack/Slice.h @@ -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;