diff --git a/arangod/Aql/ExecutionBlock.cpp b/arangod/Aql/ExecutionBlock.cpp index adbaf4b3e7..2296ebb0fa 100644 --- a/arangod/Aql/ExecutionBlock.cpp +++ b/arangod/Aql/ExecutionBlock.cpp @@ -1486,19 +1486,6 @@ int EnumerateListBlock::initialize () { return res; } - auto en = reinterpret_cast(_exeNode); - - // get the inVariable register id . . . - // planRegisters() has been run, so getPlanNode()->_varOverview is set up - auto it = getPlanNode()->getVarOverview()->varInfo.find(en->_inVariable->id); - - if (it == getPlanNode()->getVarOverview()->varInfo.end()){ - THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL, "variable not found"); - } - - _inVarRegId = (*it).second.registerId; - TRI_ASSERT(_inVarRegId < ExecutionNode::MaxRegisterId); - return TRI_ERROR_NO_ERROR; } diff --git a/arangod/Aql/ExecutionBlock.h b/arangod/Aql/ExecutionBlock.h index 521a4662eb..a17a0043a6 100644 --- a/arangod/Aql/ExecutionBlock.h +++ b/arangod/Aql/ExecutionBlock.h @@ -645,9 +645,16 @@ namespace triagens { public: EnumerateListBlock (ExecutionEngine* engine, - EnumerateListNode const* ep) - : ExecutionBlock(engine, ep) { + EnumerateListNode const* en) + : ExecutionBlock(engine, en), + _inVarRegId(ExecutionNode::MaxRegisterId) { + auto it = en->getVarOverview()->varInfo.find(en->_inVariable->id); + if (it == en->getVarOverview()->varInfo.end()){ + THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL, "variable not found"); + } + _inVarRegId = (*it).second.registerId; + TRI_ASSERT(_inVarRegId < ExecutionNode::MaxRegisterId); } ~EnumerateListBlock () {