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);