starmath: Avoid temporary arrays
Change-Id: I5ebb0acd1e6a808f3341d9b18a4a8e87b0679c5d Reviewed-on: https://gerrit.libreoffice.org/28068 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
This commit is contained in:
@@ -2082,15 +2082,13 @@ SvXMLImportContext *SmXMLDocContext_Impl::CreateChildContext(
|
||||
|
||||
void SmXMLDocContext_Impl::EndElement()
|
||||
{
|
||||
SmNodeArray ContextArray;
|
||||
ContextArray.resize(1);
|
||||
SmNodeStack &rNodeStack = GetSmImport().GetNodeStack();
|
||||
|
||||
ContextArray[0] = popOrZero(rNodeStack);
|
||||
SmNode *pContextNode = popOrZero(rNodeStack);
|
||||
|
||||
SmToken aDummy;
|
||||
std::unique_ptr<SmStructureNode> pSNode(new SmLineNode(aDummy));
|
||||
pSNode->SetSubNodes(ContextArray);
|
||||
pSNode->SetSubNodes(pContextNode, nullptr);
|
||||
rNodeStack.push_front(std::move(pSNode));
|
||||
|
||||
SmNodeArray LineArray;
|
||||
|
@@ -2138,11 +2138,9 @@ void SmParser::DoBinom()
|
||||
DoSum();
|
||||
DoSum();
|
||||
|
||||
SmNodeArray ExpressionArray(2);
|
||||
ExpressionArray[1] = popOrZero(m_aNodeStack);
|
||||
ExpressionArray[0] = popOrZero(m_aNodeStack);
|
||||
|
||||
pSNode->SetSubNodes(ExpressionArray);
|
||||
SmNode *pSecond = popOrZero(m_aNodeStack);
|
||||
SmNode *pFirst = popOrZero(m_aNodeStack);
|
||||
pSNode->SetSubNodes(pFirst, pSecond);
|
||||
m_aNodeStack.push_front(std::move(pSNode));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user