summaryrefslogtreecommitdiffstats
path: root/src/display/curve.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/display/curve.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/display/curve.cpp')
-rw-r--r--src/display/curve.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/display/curve.cpp b/src/display/curve.cpp
index 3391864ae..331701f27 100644
--- a/src/display/curve.cpp
+++ b/src/display/curve.cpp
@@ -158,9 +158,9 @@ SPCurve::split() const
{
std::list<SPCurve *> l;
- for (Geom::PathVector::const_iterator path_it = _pathv.begin(); path_it != _pathv.end(); ++path_it) {
+ for (const auto & path_it : _pathv) {
Geom::PathVector newpathv;
- newpathv.push_back(*path_it);
+ newpathv.push_back(path_it);
SPCurve * newcurve = new SPCurve(newpathv);
l.push_back(newcurve);
}
@@ -327,8 +327,8 @@ SPCurve::is_closed() const
return false;
}
- for (Geom::PathVector::const_iterator it = _pathv.begin(); it != _pathv.end(); ++it) {
- if ( ! it->closed() ) {
+ for (const auto & it : _pathv) {
+ if ( ! it.closed() ) {
return false;
}
}
@@ -531,8 +531,8 @@ SPCurve::append(SPCurve const *curve2,
_pathv.push_back( (*it) );
}
} else {
- for (Geom::PathVector::const_iterator it = curve2->_pathv.begin(); it != curve2->_pathv.end(); ++it) {
- _pathv.push_back( (*it) );
+ for (const auto & it : curve2->_pathv) {
+ _pathv.push_back( it );
}
}
}
@@ -658,10 +658,10 @@ size_t
SPCurve::nodes_in_path() const
{
size_t nr = 0;
- for(Geom::PathVector::const_iterator it = _pathv.begin(); it != _pathv.end(); ++it) {
+ for(const auto & it : _pathv) {
// if the path does not have any segments, it is a naked moveto,
// and therefore any path has at least one valid node
- size_t psize = std::max<size_t>(1, it->size_closed());
+ size_t psize = std::max<size_t>(1, it.size_closed());
nr += psize;
}