unless this is for clarity couldn't we simply to `if (hasChildren && !(startNode->collapseIdenticalLeaves())`