From fc5804a1576d706144e459e82f3d59f720f0e28b Mon Sep 17 00:00:00 2001 From: Sugui Date: Sat, 2 Dec 2023 10:40:10 +0100 Subject: [PATCH] removed unnecesary curly braces --- src/main/java/sugui/Day02.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/sugui/Day02.java b/src/main/java/sugui/Day02.java index 1be54fc..ebe5dcb 100644 --- a/src/main/java/sugui/Day02.java +++ b/src/main/java/sugui/Day02.java @@ -71,10 +71,8 @@ public class Day02 { public static String getFirstPuzzleResult(String input) { List games = parse(input); int result = games.stream() - .filter(game -> { - return game.bunches.stream().allMatch(bunch -> bunch.red <= MAX_RED_CONTENTS - && bunch.green <= MAX_GREEN_CONTENTS && bunch.blue <= MAX_BLUE_CONTENTS); - }) + .filter(game -> game.bunches.stream().allMatch(bunch -> bunch.red <= MAX_RED_CONTENTS + && bunch.green <= MAX_GREEN_CONTENTS && bunch.blue <= MAX_BLUE_CONTENTS)) .map(game -> game.id) .reduce(0, (a, b) -> a + b); return Integer.toString(result);