diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2018-02-14 22:08:37 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2018-02-15 11:13:52 +0100 |
commit | abcd7825101afb9ef9ff93932f8e1bd7c3bb91bb (patch) | |
tree | fabc5ff05ba53261c71ee7ab68ff79f3a935dae8 /starmath/source/cursor.cxx | |
parent | 1c8efde4daea648204e3ba19f8edc01ef3e548bd (diff) |
starmath: Prefer moving subnodes to copying them
Change-Id: Id92dd0715daf43a63d09529f01a6583c23de7c7d
Reviewed-on: https://gerrit.libreoffice.org/49725
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
Diffstat (limited to 'starmath/source/cursor.cxx')
-rw-r--r-- | starmath/source/cursor.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
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; } |