diff --git a/arangod/Aql/IResearchViewExecutor.cpp b/arangod/Aql/IResearchViewExecutor.cpp index ddb94181d97f..3cb966765fd2 100644 --- a/arangod/Aql/IResearchViewExecutor.cpp +++ b/arangod/Aql/IResearchViewExecutor.cpp @@ -273,10 +273,8 @@ IndexIterator::DocumentCallback IResearchViewExecutorBase::ReadCon typedef std::function CallbackFactory; static CallbackFactory const callbackFactory{[](ReadContext& ctx) { - return [&ctx](LocalDocumentId /*id*/, VPackSlice doc) { - AqlValue a{AqlValueHintCopy(doc.begin())}; - AqlValueGuard guard{a, true}; - ctx.outputRow.moveValueInto(ctx.getDocumentReg(), ctx.inputRow, guard); + return [&ctx](LocalDocumentId /*id*/, VPackSlice const doc) { + ctx.outputRow.moveValueInto(ctx.getDocumentReg(), ctx.inputRow, doc); return true; }; }}; @@ -629,15 +627,14 @@ bool IResearchViewExecutorBase::writeLocalDocumentId( // For sake of performance we store raw pointer to collection // It is safe as pipeline work inside one process static_assert(sizeof(void*) <= sizeof(uint64_t), - "Pointer not fits in uint64_t"); - AqlValue a(AqlValueHintUInt(reinterpret_cast(&collection))); - AqlValueGuard guard{a, true}; - ctx.outputRow.moveValueInto(ctx.getCollectionPointerReg(), ctx.inputRow, guard); + "Pointer doesn't fit uint64_t"); + + AqlValueHintUInt const value{reinterpret_cast(&collection)}; + ctx.outputRow.moveValueInto(ctx.getCollectionPointerReg(), ctx.inputRow, value); } { - AqlValue a(AqlValueHintUInt(documentId.id())); - AqlValueGuard guard{a, true}; - ctx.outputRow.moveValueInto(ctx.getDocumentIdReg(), ctx.inputRow, guard); + AqlValueHintUInt const value{documentId.id()}; + ctx.outputRow.moveValueInto(ctx.getDocumentIdReg(), ctx.inputRow, value); } return true; } else { @@ -654,7 +651,7 @@ inline bool IResearchViewExecutorBase::writeStoredValue( auto const& storedValue = storedValues[index]; TRI_ASSERT(!storedValue.empty()); auto const totalSize = storedValue.size(); - auto slice = VPackSlice(storedValue.c_str()); + VPackSlice slice{storedValue.c_str()}; size_t size = 0; size_t i = 0; for (auto const& [fieldNum, registerId] : fieldsRegs) { @@ -664,13 +661,13 @@ inline bool IResearchViewExecutorBase::writeStoredValue( if (ADB_UNLIKELY(size > totalSize)) { return false; } - slice = VPackSlice(slice.end()); + slice = VPackSlice{slice.end()}; ++i; } TRI_ASSERT(!slice.isNone()); - AqlValue v(slice); - AqlValueGuard guard{v, true}; - ctx.outputRow.moveValueInto(registerId, ctx.inputRow, guard); + + VPackSlice const& value = slice; + ctx.outputRow.moveValueInto(registerId, ctx.inputRow, value); } return true; }