[geos-commits] [SCM] GEOS branch master updated. c4bfa4585e74bd63f1df1000a115ff3aa2ddd327
git at osgeo.org
git at osgeo.org
Tue Aug 27 09:19:53 PDT 2019
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".
The branch, master has been updated
via c4bfa4585e74bd63f1df1000a115ff3aa2ddd327 (commit)
from fa0ff9bb09549a4aa3975b371975edf46855fb4a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c4bfa4585e74bd63f1df1000a115ff3aa2ddd327
Author: Daniel Baston <dbaston at gmail.com>
Date: Tue Aug 27 12:19:35 2019 -0400
Use empty() instead of size() where possible
Fixes #860
diff --git a/src/algorithm/Distance.cpp b/src/algorithm/Distance.cpp
index 8a88a82..a8c6e6c 100644
--- a/src/algorithm/Distance.cpp
+++ b/src/algorithm/Distance.cpp
@@ -180,7 +180,7 @@ double
Distance::pointToSegmentString(const geom::Coordinate& p,
const geom::CoordinateSequence* seq)
{
- if(seq->size() == 0) {
+ if(seq->isEmpty()) {
throw util::IllegalArgumentException(
"Line array must contain at least one vertex");
}
diff --git a/src/index/intervalrtree/SortedPackedIntervalRTree.cpp b/src/index/intervalrtree/SortedPackedIntervalRTree.cpp
index a01ab37..83b4829 100644
--- a/src/index/intervalrtree/SortedPackedIntervalRTree.cpp
+++ b/src/index/intervalrtree/SortedPackedIntervalRTree.cpp
@@ -42,7 +42,7 @@ SortedPackedIntervalRTree::init()
* if leaves is empty then nothing has been inserted.
* In this case it is safe to leave the tree in an open state
*/
- if (leaves.size() == 0) return;
+ if (leaves.empty()) return;
root = buildTree();
}
diff --git a/src/operation/buffer/BufferBuilder.cpp b/src/operation/buffer/BufferBuilder.cpp
index 0bc6d7e..e7f2b3c 100644
--- a/src/operation/buffer/BufferBuilder.cpp
+++ b/src/operation/buffer/BufferBuilder.cpp
@@ -408,7 +408,7 @@ BufferBuilder::buffer(const Geometry* g, double distance)
<< " curves" << std::endl;
#endif
// short-circuit test
- if(bufferSegStrList.size() <= 0) {
+ if(bufferSegStrList.empty()) {
return createEmptyResultGeometry();
}
diff --git a/src/simplify/DouglasPeuckerLineSimplifier.cpp b/src/simplify/DouglasPeuckerLineSimplifier.cpp
index bcd0418..634ad55 100644
--- a/src/simplify/DouglasPeuckerLineSimplifier.cpp
+++ b/src/simplify/DouglasPeuckerLineSimplifier.cpp
@@ -62,7 +62,7 @@ DouglasPeuckerLineSimplifier::simplify()
CoordsVectAutoPtr coordList(new CoordsVect());
// empty coordlist is the simplest, won't simplify further
- if(! pts.size()) {
+ if(pts.empty()) {
return coordList;
}
diff --git a/src/simplify/TaggedLineString.cpp b/src/simplify/TaggedLineString.cpp
index b2be0c8..680aa4b 100644
--- a/src/simplify/TaggedLineString.cpp
+++ b/src/simplify/TaggedLineString.cpp
@@ -81,7 +81,7 @@ TaggedLineString::init()
<< endl;
#endif
- if(pts->size()) {
+ if(!pts->isEmpty()) {
segs.reserve(pts->size() - 1);
diff --git a/src/simplify/TaggedLineStringSimplifier.cpp b/src/simplify/TaggedLineStringSimplifier.cpp
index b97d9b1..64ebed3 100644
--- a/src/simplify/TaggedLineStringSimplifier.cpp
+++ b/src/simplify/TaggedLineStringSimplifier.cpp
@@ -76,7 +76,7 @@ TaggedLineStringSimplifier::simplify(TaggedLineString* nLine)
<< std::endl;
#endif
- if(! linePts->size()) {
+ if(linePts->isEmpty()) {
return;
}
simplifySection(0, linePts->size() - 1, 0);
-----------------------------------------------------------------------
Summary of changes:
src/algorithm/Distance.cpp | 2 +-
src/index/intervalrtree/SortedPackedIntervalRTree.cpp | 2 +-
src/operation/buffer/BufferBuilder.cpp | 2 +-
src/simplify/DouglasPeuckerLineSimplifier.cpp | 2 +-
src/simplify/TaggedLineString.cpp | 2 +-
src/simplify/TaggedLineStringSimplifier.cpp | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list