diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2016-08-12 17:44:40 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2016-08-15 04:50:13 +0000 |
commit | 93eb0896bc30163dba47e20459dd0d14fb9770f9 (patch) | |
tree | 930c7a4f5820bffe60a893c8fd023c7d79ed9170 /starmath/source | |
parent | e22fc8076f347702670134cb7a36d523d046423c (diff) |
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>
Diffstat (limited to 'starmath/source')
-rw-r--r-- | starmath/source/mathmlimport.cxx | 6 | ||||
-rw-r--r-- | starmath/source/parse.cxx | 8 |
2 files changed, 5 insertions, 9 deletions
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx index 8946c6f5a59f..2690824939bd 100644 --- a/starmath/source/mathmlimport.cxx +++ b/starmath/source/mathmlimport.cxx @@ -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; diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx index 1e11be32fa91..7a6c99551e68 100644 --- a/starmath/source/parse.cxx +++ b/starmath/source/parse.cxx @@ -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)); } |