addLightNode(): flatten nested if case
@@ -1343,8 +1343,11 @@ void DeRestPluginPrivate::addLightNode(const deCONZ::Node *node)
}
}
- if (lightNode.haEndpoint().isValid())
+ if (!lightNode.haEndpoint().isValid())
{
+ continue;
+ }
+
Q_Q(DeRestPlugin);
lightNode.setNode(const_cast<deCONZ::Node*>(node));
lightNode.address() = node->address();
@@ -1449,7 +1452,8 @@ void DeRestPluginPrivate::addLightNode(const deCONZ::Node *node)
DBG_Printf(DBG_INFO, "LightNode %u: %s added\n", lightNode.id().toUInt(), qPrintable(lightNode.name()));
- nodes.push_back(std::move(lightNode));
+ //nodes.push_back(std::move(lightNode));
+ nodes.push_back(lightNode);
lightNode2 = &nodes.back();
queuePollNode(lightNode2);
@@ -1470,7 +1474,6 @@ void DeRestPluginPrivate::addLightNode(const deCONZ::Node *node)
}
}
}
-}
/*! Force polling if the node has updated simple descriptors in setup phase.
\param node - the base for the LightNode
