From 6893d8b193fa809f7cd7cd9c44b1733b6b5607cb Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Sun, 18 Feb 2018 16:00:39 +0900 Subject: starmath: Spare unnecessary assignments Change-Id: I8ddc1c04a76475d63a39dc21d36cda7a7aa26b9e Reviewed-on: https://gerrit.libreoffice.org/49921 Tested-by: Jenkins Reviewed-by: Takeshi Abe --- starmath/inc/node.hxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'starmath') diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx index f4d90b9ada05..7479e3385503 100644 --- a/starmath/inc/node.hxx +++ b/starmath/inc/node.hxx @@ -266,12 +266,13 @@ public: { //Resize subnodes array maSubNodes.resize(nIndex + 1); - //Set new slots to NULL - for (size_t i = size; i < nIndex+1; i++) + //Set new slots to NULL except at nIndex + for (size_t i = size; i < nIndex; i++) maSubNodes[i] = nullptr; } maSubNodes[nIndex] = pNode; - ClaimPaternity(); + if (pNode) + pNode->SetParent(this); } private: -- cgit