summaryrefslogtreecommitdiffstats
path: root/src/object/sp-conn-end-pair.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2019-01-02 09:41:30 +0000
committerMarc Jeanmougin <marc@jeanmougin.fr>2019-01-02 09:41:30 +0000
commit169dff19d4da8d76e69b8e896aa25b0013639c03 (patch)
treea0c070fa95188b5cde708ac285e6a2db9df4a83f /src/object/sp-conn-end-pair.cpp
parentAvoid creating a new document before opening an old document. (diff)
downloadinkscape-169dff19d4da8d76e69b8e896aa25b0013639c03.tar.gz
inkscape-169dff19d4da8d76e69b8e896aa25b0013639c03.zip
modernize loops
Diffstat (limited to 'src/object/sp-conn-end-pair.cpp')
-rw-r--r--src/object/sp-conn-end-pair.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/object/sp-conn-end-pair.cpp b/src/object/sp-conn-end-pair.cpp
index a47736129..2f60e9a9e 100644
--- a/src/object/sp-conn-end-pair.cpp
+++ b/src/object/sp-conn-end-pair.cpp
@@ -45,21 +45,21 @@ SPConnEndPair::SPConnEndPair(SPPath *const owner)
SPConnEndPair::~SPConnEndPair()
{
- for (unsigned handle_ix = 0; handle_ix < 2; ++handle_ix) {
- delete this->_connEnd[handle_ix];
- this->_connEnd[handle_ix] = nullptr;
+ for (auto & handle_ix : this->_connEnd) {
+ delete handle_ix;
+ handle_ix = nullptr;
}
}
void SPConnEndPair::release()
{
- for (unsigned handle_ix = 0; handle_ix < 2; ++handle_ix) {
- this->_connEnd[handle_ix]->_changed_connection.disconnect();
- this->_connEnd[handle_ix]->_delete_connection.disconnect();
- this->_connEnd[handle_ix]->_transformed_connection.disconnect();
- g_free(this->_connEnd[handle_ix]->href);
- this->_connEnd[handle_ix]->href = nullptr;
- this->_connEnd[handle_ix]->ref.detach();
+ for (auto & handle_ix : this->_connEnd) {
+ handle_ix->_changed_connection.disconnect();
+ handle_ix->_delete_connection.disconnect();
+ handle_ix->_transformed_connection.disconnect();
+ g_free(handle_ix->href);
+ handle_ix->href = nullptr;
+ handle_ix->ref.detach();
}
// If the document is being destroyed then the router instance