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/tool/transform-handle-set.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/ui/tool/transform-handle-set.cpp') diff --git a/src/ui/tool/transform-handle-set.cpp b/src/ui/tool/transform-handle-set.cpp index 781675a99..c1d6692bc 100644 --- a/src/ui/tool/transform-handle-set.cpp +++ b/src/ui/tool/transform-handle-set.cpp @@ -154,8 +154,8 @@ bool TransformHandle::grabbed(GdkEventMotion *) _all_snap_sources_sorted = _snap_points; // Calculate and store the distance to the reference point for each snap candidate point - for(std::vector::iterator i = _all_snap_sources_sorted.begin(); i != _all_snap_sources_sorted.end(); ++i) { - (*i).setDistance(Geom::L2((*i).getPoint() - _origin)); + for(auto & i : _all_snap_sources_sorted) { + i.setDistance(Geom::L2(i.getPoint() - _origin)); } // Sort them ascending, using the distance calculated above as the single criteria @@ -724,8 +724,8 @@ TransformHandleSet::TransformHandleSet(SPDesktop *d, SPCanvasGroup *th_group) TransformHandleSet::~TransformHandleSet() { - for (unsigned i = 0; i < 17; ++i) { - delete _handles[i]; + for (auto & _handle : _handles) { + delete _handle; } } @@ -844,9 +844,9 @@ void TransformHandleSet::_updateVisibility(bool v) _center->setVisible(show_rotate /*&& bp[Geom::X] > handle_size[Geom::X] && bp[Geom::Y] > handle_size[Geom::Y]*/); } else { - for (unsigned i = 0; i < 17; ++i) { - if (_handles[i] != _active) - _handles[i]->setVisible(false); + for (auto & _handle : _handles) { + if (_handle != _active) + _handle->setVisible(false); } } -- cgit v1.2.3