Fix -Wunused-comparison in for() loop

Fixes potential issues when loading a session where state
and IO port-count mismatches. Not sure if that can ever happen.
This commit is contained in:
Robin Gareus 2021-03-17 17:59:36 +01:00
parent ee6e7e8a7e
commit 71f8c8ff38
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -615,7 +615,7 @@ IO::set_state (const XMLNode& node, int version)
*/
PortSet::iterator i = _ports.begin();
XMLNodeConstIterator x = node.children().begin();
for (; i != _ports.end(), x != node.children().end(); ++i, ++x) {
for (; i != _ports.end() && x != node.children().end(); ++i, ++x) {
if ((*x)->name() == "Port") {
(*x)->remove_property (X_("name"));
(*x)->set_property (X_("name"), i->name());