From 1604b150d431ff305c19a73e9399c6bd9f303638 Mon Sep 17 00:00:00 2001 From: glax Date: Mon, 29 Jul 2024 01:30:27 +0200 Subject: [PATCH] readonly dictionaries for speed --- astar/PathingHelper/SpeedHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/astar/PathingHelper/SpeedHelper.cs b/astar/PathingHelper/SpeedHelper.cs index 98eb153..adb60d4 100644 --- a/astar/PathingHelper/SpeedHelper.cs +++ b/astar/PathingHelper/SpeedHelper.cs @@ -18,7 +18,7 @@ internal static class SpeedHelper return car ? SpeedCar.MaxBy(s => s.Value).Value : SpeedPedestrian.MaxBy(s => s.Value).Value; } - private static Dictionary SpeedPedestrian = new() { + private static readonly Dictionary SpeedPedestrian = new() { { HighwayType.NONE, 0 }, { HighwayType.motorway, 0 }, { HighwayType.trunk, 0 }, @@ -50,7 +50,7 @@ internal static class SpeedHelper { HighwayType.construction, 0 } }; - private static Dictionary SpeedCar = new() { + private static readonly Dictionary SpeedCar = new() { { HighwayType.NONE, 0 }, { HighwayType.motorway, 120 }, { HighwayType.trunk, 80 },