From 1a022d9219ddbca4323e4190fcc9abbc592b3acc Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Thu, 28 Feb 2019 12:03:23 +0100
Subject: [PATCH] [GL] Polygon: Reduce scope of varialble.

cppcheck message:
The scope of the variable 'n_intersections' can be reduced.
---
 GeoLib/Polygon.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/GeoLib/Polygon.cpp b/GeoLib/Polygon.cpp
index 3f712213bd0..d9d93762d9c 100644
--- a/GeoLib/Polygon.cpp
+++ b/GeoLib/Polygon.cpp
@@ -81,10 +81,8 @@ bool Polygon::isPntInPolygon (GeoLib::Point const & pnt) const
         return false;
     }
 
-    std::size_t n_intersections (0);
-    GeoLib::Point s;
-
     if (_simple_polygon_list.size() == 1) {
+        std::size_t n_intersections(0);
         const std::size_t n_nodes (getNumberOfPoints() - 1);
         for (std::size_t k(0); k < n_nodes; k++) {
             if (((*(getPoint(k)))[1] <= pnt[1] && pnt[1] <= (*(getPoint(k + 1)))[1]) ||
-- 
GitLab