From 8ca21fcdf491eb7412b854b4ad3279978b340cce Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Wed, 1 Dec 2021 08:57:31 +0100 Subject: [PATCH] Cleaned up a bit. --- source/day1/part2.d | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/source/day1/part2.d b/source/day1/part2.d index 83d0ec7..4b07f64 100644 --- a/source/day1/part2.d +++ b/source/day1/part2.d @@ -9,11 +9,7 @@ void slidingSum() { int increaseCount = 0; foreach (i; 1 .. (values.length - 2)) { int currentSum = values[i] + values[i + 1] + values[i + 2]; - bool increase = false; - if (currentSum > previousSum) { - increaseCount++; - increase = true; - } + if (currentSum > previousSum) increaseCount++; previousSum = currentSum; } writefln("%d", increaseCount);