Change RemoveAllNonHighways wayIDs, nodeIds to Hashsets

This commit is contained in:
glax 2024-07-23 23:14:33 +02:00
parent f6c79aca77
commit 4f98563a1e

View File

@ -168,8 +168,8 @@ public class Converter(float regionSize, string? exportFolderPath = null, ILogge
int count = 0;
DateTime print = DateTime.Now;
DateTime start = DateTime.Now;
List<ulong> wayIds = new();
List<ulong> nodeIds = new();
HashSet<ulong> wayIds = new();
HashSet<ulong> nodeIds = new();
foreach (string path in wayRegionsPaths)
{
if (DateTime.Now - print > TimeSpan.FromSeconds(2))
@ -198,7 +198,8 @@ public class Converter(float regionSize, string? exportFolderPath = null, ILogge
{
waysStreamWriter.WriteLine(line);
wayIds.Add(w.ID);
nodeIds.AddRange(w.NodeIds);
foreach (ulong nodeId in w.NodeIds)
nodeIds.Add(nodeId);
hasWritten = true;
}else
logger?.LogTrace($"Way {w.ID} is not a highway. BYE!");