Kaydet (Commit) df755b1b authored tarafından Michael Meeks's avatar Michael Meeks

Avoid using the hideous std::stack -> deque inside ::Interpret

dequeue loves to allocate and free memory crazily, vector is much saner.

Change-Id: Idcd2c1d693594f280ce94423161651502f25dc2d
Reviewed-on: https://gerrit.libreoffice.org/45086Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
Tested-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst 7ced0f88
......@@ -3959,7 +3959,7 @@ StackVar ScInterpreter::Interpret()
sal_uLong nRetIndexExpr = 0;
sal_uInt16 nErrorFunction = 0;
sal_uInt16 nErrorFunctionCount = 0;
std::stack<sal_uInt16> aErrorFunctionStack;
std::vector<sal_uInt16> aErrorFunctionStack;
sal_uInt16 nStackBase;
nGlobalError = FormulaError::NONE;
......@@ -4522,15 +4522,15 @@ StackVar ScInterpreter::Interpret()
if ( nLevel == 1 || (nLevel == 2 && aCode.IsEndOfPath()) )
{
if (nLevel == 1)
aErrorFunctionStack.push( nErrorFunction);
aErrorFunctionStack.push_back( nErrorFunction);
bGotResult = JumpMatrix( nLevel );
if (aErrorFunctionStack.empty())
assert(!"ScInterpreter::Interpret - aErrorFunctionStack empty in JumpMatrix context");
else
{
nErrorFunction = aErrorFunctionStack.top();
nErrorFunction = aErrorFunctionStack.back();
if (bGotResult)
aErrorFunctionStack.pop();
aErrorFunctionStack.pop_back();
}
}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment