From 169dff19d4da8d76e69b8e896aa25b0013639c03 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Wed, 2 Jan 2019 10:41:30 +0100 Subject: modernize loops --- src/ui/tools/connector-tool.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/ui/tools/connector-tool.cpp') diff --git a/src/ui/tools/connector-tool.cpp b/src/ui/tools/connector-tool.cpp index 95b13f92c..5a1654e2f 100644 --- a/src/ui/tools/connector-tool.cpp +++ b/src/ui/tools/connector-tool.cpp @@ -190,11 +190,11 @@ ConnectorTool::~ConnectorTool() { this->sel_changed_connection.disconnect(); - for (int i = 0; i < 2; ++i) { + for (auto & i : this->endpt_handle) { if (this->endpt_handle[1]) { //g_object_unref(this->endpt_handle[i]); - knot_unref(this->endpt_handle[i]); - this->endpt_handle[i] = nullptr; + knot_unref(i); + i = nullptr; } } @@ -313,8 +313,8 @@ static void cc_clear_active_knots(SPKnotList k) { // Hide the connection points if they exist. if (k.size()) { - for (SPKnotList::iterator it = k.begin(); it != k.end(); ++it) { - it->first->hide(); + for (auto & it : k) { + it.first->hide(); } } } @@ -335,9 +335,9 @@ void ConnectorTool::cc_clear_active_conn() } // Hide the endpoint handles. - for (int i = 0; i < 2; ++i) { - if (this->endpt_handle[i]) { - this->endpt_handle[i]->hide(); + for (auto & i : this->endpt_handle) { + if (i) { + i->hide(); } } } -- cgit v1.2.3