diff options
Diffstat (limited to 'src/mbgl/util/intersection_tests.cpp')
-rw-r--r-- | src/mbgl/util/intersection_tests.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mbgl/util/intersection_tests.cpp b/src/mbgl/util/intersection_tests.cpp index 780fce98f9..e236a1999f 100644 --- a/src/mbgl/util/intersection_tests.cpp +++ b/src/mbgl/util/intersection_tests.cpp @@ -30,7 +30,7 @@ bool pointIntersectsBufferedLine(const GeometryCoordinate& p, const GeometryCoor const float radiusSquared = radius * radius; if (line.size() == 1) return util::distSqr<float>(p, line.at(0)) < radiusSquared; - if (line.size() == 0) return false; + if (line.empty()) return false; for (auto i = line.begin() + 1; i != line.end(); i++) { // Find line segments that have a distance <= radius^2 to p @@ -52,7 +52,7 @@ bool lineSegmentIntersectsLineSegment(const GeometryCoordinate& a0, const Geomet isCounterClockwise(a0, a1, b0) != isCounterClockwise(a0, a1, b1); } bool lineIntersectsLine(const GeometryCoordinates& lineA, const GeometryCoordinates& lineB) { - if (lineA.size() == 0 || lineB.size() == 0) return false; + if (lineA.empty() || lineB.empty()) return false; for (auto i = lineA.begin(); i != lineA.end() - 1; i++) { auto& a0 = *i; auto& a1 = *(i + 1); @@ -120,9 +120,7 @@ bool polygonIntersectsPolygon(const GeometryCoordinates& polygonA, const Geometr if (polygonContainsPoint(polygonA, p)) return true; } - if (lineIntersectsLine(polygonA, polygonB)) return true; - - return false; + return lineIntersectsLine(polygonA, polygonB); } bool polygonIntersectsMultiPolygon(const GeometryCoordinates& polygon, const GeometryCollection& multiPolygon) { |