From 7833eb5e832bed3cd4716f36411cf921c2de9214 Mon Sep 17 00:00:00 2001 From: glax Date: Wed, 24 Jul 2024 01:16:12 +0200 Subject: [PATCH] Removed unnecessary Object creation Added logline after load of region. --- OSM_Regions/RegionLoader.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OSM_Regions/RegionLoader.cs b/OSM_Regions/RegionLoader.cs index f60a4c5..c07c8fe 100644 --- a/OSM_Regions/RegionLoader.cs +++ b/OSM_Regions/RegionLoader.cs @@ -46,7 +46,7 @@ public class RegionLoader(float regionSize, string? importFolderPath = null, ILo if(line is null) continue; Node n = Node.Deserialize(line); - ret.Nodes.Add(n.ID, new Graph.Node(n.Lat, n.Lon)); + ret.Nodes.Add(n.ID, n); } logger?.LogDebug($"Loading Ways {waysPath}"); @@ -56,7 +56,7 @@ public class RegionLoader(float regionSize, string? importFolderPath = null, ILo if(line is null) continue; Way w = Way.Deserialize(line); - ret.Ways.Add(w.ID, new Graph.Way(w.Tags)); + ret.Ways.Add(w.ID, w); for (int i = 1; i < w.NodeIds.Count; i++) { ulong node1Id = w.NodeIds[i - 1]; @@ -74,6 +74,7 @@ public class RegionLoader(float regionSize, string? importFolderPath = null, ILo nodesReader.Dispose(); waysReader.Dispose(); + logger?.LogDebug($"Loaded Region {regionId} {ret.Nodes.Count} Nodes {ret.Ways.Count} Ways"); return ret; }