From abcd7825101afb9ef9ff93932f8e1bd7c3bb91bb Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Wed, 14 Feb 2018 22:08:37 +0900 Subject: starmath: Prefer moving subnodes to copying them Change-Id: Id92dd0715daf43a63d09529f01a6583c23de7c7d Reviewed-on: https://gerrit.libreoffice.org/49725 Tested-by: Jenkins Reviewed-by: Takeshi Abe --- starmath/source/cursor.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'starmath/source/cursor.cxx') diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx index bc6d5227d043..1d0e987e02cc 100644 --- a/starmath/source/cursor.cxx +++ b/starmath/source/cursor.cxx @@ -219,7 +219,7 @@ void SmCursor::DeletePrev(OutputDevice* pDev){ else if(i > nLineOffset) lines[i-1] = pLineParent->GetSubNode(i); } - pLineParent->SetSubNodes(lines); + pLineParent->SetSubNodes(std::move(lines)); //Rebuild graph mpAnchor = nullptr; mpPosition = nullptr; @@ -1147,8 +1147,7 @@ SmNodeList* SmCursor::LineToList(SmStructureNode* pLine, SmNodeList* list){ list->push_back(pChild); } } - SmNodeArray emptyArray(0); - pLine->SetSubNodes(emptyArray); + pLine->ClearSubNodes(); delete pLine; return list; } @@ -1436,7 +1435,7 @@ SmNode* SmNodeListParser::Expression(){ //Create SmExpressionNode, I hope SmToken() will do :) SmStructureNode* pExpr = new SmExpressionNode(SmToken()); - pExpr->SetSubNodes(NodeArray); + pExpr->SetSubNodes(std::move(NodeArray)); return pExpr; } -- cgit