From fe04c976fcccb75e2946031ee2e9511d4a71bd2d Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <github@naumov.de>
Date: Fri, 15 Sep 2023 21:07:45 +0200
Subject: [PATCH] [GL] Reduce variable scope

---
 GeoLib/GEOObjects.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/GeoLib/GEOObjects.cpp b/GeoLib/GEOObjects.cpp
index a062996c3f9..4073331e971 100644
--- a/GeoLib/GEOObjects.cpp
+++ b/GeoLib/GEOObjects.cpp
@@ -743,16 +743,16 @@ GeoLib::GeoObject const* GEOObjects::getGeoObject(
 
 std::size_t GEOObjects::exists(const std::string& geometry_name) const
 {
-    std::size_t const size(_pnt_vecs.size());
-    auto const it = findVectorByName(_pnt_vecs, geometry_name);
-    if (it != _pnt_vecs.end())
+    if (auto const it = findVectorByName(_pnt_vecs, geometry_name);
+        it != _pnt_vecs.end())
     {
         return std::distance(_pnt_vecs.begin(), it);
     }
 
     // HACK for enabling conversion of files without loading the associated
     // geometry
-    if (size > 0 && _pnt_vecs[0]->getName() == "conversionTestRun#1")
+    if (_pnt_vecs.size() > 0 &&
+        _pnt_vecs[0]->getName() == "conversionTestRun#1")
     {
         return 1;
     }
-- 
GitLab