From 5169f70f3522ca829be8a11941bb2f5f81512209 Mon Sep 17 00:00:00 2001 From: lseguin Date: Thu, 21 Dec 2023 00:32:58 +0100 Subject: [PATCH] minor fix --- 2023/Day08/Solution.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/2023/Day08/Solution.cs b/2023/Day08/Solution.cs index 21311b090..c717158d9 100644 --- a/2023/Day08/Solution.cs +++ b/2023/Day08/Solution.cs @@ -10,6 +10,8 @@ namespace AdventOfCode.Y2023.Day08; [ProblemName("Haunted Wasteland")] class Solution : Solver { + private static readonly string[] Separator = { " = " }; + public object PartOne(string input) { var lines = input.Split("\n", StringSplitOptions.RemoveEmptyEntries); @@ -28,12 +30,12 @@ public object PartTwo(string input) return CompleteGhostsTravel(directions, map); } - private Dictionary ParseMap(List lines) + private static Dictionary ParseMap(List lines) { var map = new Dictionary(); foreach (var line in lines) { - var parts = line.Split(new[] { " = " }, StringSplitOptions.None); + var parts = line.Split(Separator, StringSplitOptions.None); var key = parts[0]; var values = parts[1].Trim('(', ')').Split(',');