From: Ummon Date: Tue, 5 Dec 2017 07:44:17 +0000 (+0100) Subject: Do not parse input twice X-Git-Url: https://git.euphorik.ch/?a=commitdiff_plain;h=aeae7c191667a05b483d2058f4e2f0f720d799a9;p=advent_of_code_2017.git Do not parse input twice --- diff --git a/AdventOfCode2017/Program.fs b/AdventOfCode2017/Program.fs index db1ca80..574d6d9 100644 --- a/AdventOfCode2017/Program.fs +++ b/AdventOfCode2017/Program.fs @@ -20,8 +20,8 @@ let day4 () = sprintf "part1 = %A, part2 = %A" (Day4.nbPassphrasesValid Day4.passphraseValid input) (Day4.nbPassphrasesValid Day4.passphraseValidAnagram input) let day5 () = - let input = File.ReadAllText "Data/day5.input" - sprintf "part1 = %A, part2 = %A" (Day5.nbSteps1 (Day5.parseInput input)) (Day5.nbSteps2 (Day5.parseInput input)) + let input = File.ReadAllText "Data/day5.input" |> Day5.parseInput + sprintf "part1 = %A, part2 = %A" (Day5.nbSteps1 input) (Day5.nbSteps2 input) let doDay (n : int) = let result =