diff --git a/3rdParty/velocypack/include/velocypack/Iterator.h b/3rdParty/velocypack/include/velocypack/Iterator.h index f22078d5b0..5e8ab3251b 100644 --- a/3rdParty/velocypack/include/velocypack/Iterator.h +++ b/3rdParty/velocypack/include/velocypack/Iterator.h @@ -246,18 +246,18 @@ class ObjectIterator { return ObjectPair(_slice.getNthKey(_position, true), _slice.getNthValue(_position)); } - ObjectIterator begin() { return ObjectIterator(_slice, _allowRandomIteration); } + ObjectIterator begin() { return ObjectIterator(*this); } - ObjectIterator begin() const { return ObjectIterator(_slice, _allowRandomIteration); } + ObjectIterator begin() const { return ObjectIterator(*this); } ObjectIterator end() { - auto it = ObjectIterator(_slice, _allowRandomIteration); + auto it = ObjectIterator(*this); it._position = it._size; return it; } ObjectIterator end() const { - auto it = ObjectIterator(_slice, _allowRandomIteration); + auto it = ObjectIterator(*this); it._position = it._size; return it; } diff --git a/arangod/VocBase/LogicalCollection.cpp b/arangod/VocBase/LogicalCollection.cpp index 5612508fbf..ad45f906ac 100644 --- a/arangod/VocBase/LogicalCollection.cpp +++ b/arangod/VocBase/LogicalCollection.cpp @@ -3595,7 +3595,7 @@ void LogicalCollection::mergeObjectsForUpdate( { VPackObjectIterator it(newValue, true); while (it.valid()) { - StringRef key(it.key()); + std::string key = it.key().copyString(); if (!key.empty() && key[0] == '_' && (key == StaticStrings::KeyString || key == StaticStrings::IdString || key == StaticStrings::RevString || @@ -3609,7 +3609,7 @@ void LogicalCollection::mergeObjectsForUpdate( } // else do nothing } else { // regular attribute - newValues.emplace(std::string(key.data(), key.size()), it.value()); + newValues.emplace(std::move(key), it.value()); } it.next();