From 54053389ef841d1de2a19b7de173f07123cc1fb1 Mon Sep 17 00:00:00 2001 From: Hector Caballero Date: Mon, 29 Jan 2018 20:24:23 -0500 Subject: [PATCH] GC: Simplify lambda filter() stream operation also accepts a lambda expression. Signed-off-by: Hector Oswaldo Caballero Change-Id: Ie0b7fe43d39593172969fd16c3e44b49bac27306 --- .../src/org/eclipse/jgit/internal/storage/file/GC.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java index 2be38b980e..75b0f0b25b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java @@ -931,11 +931,10 @@ public class GC { List fileNames = null; try (Stream files = Files.list(packDir)) { fileNames = files.map(path -> path.getFileName().toString()) - .filter(name -> { - return (name.endsWith(PACK_EXT) - || name.endsWith(BITMAP_EXT) - || name.endsWith(INDEX_EXT)); - }).sorted(Collections.reverseOrder()) + .filter(name -> (name.endsWith(PACK_EXT) + || name.endsWith(BITMAP_EXT) + || name.endsWith(INDEX_EXT))) + .sorted(Collections.reverseOrder()) .collect(Collectors.toList()); } catch (IOException e1) { // ignore -- 2.39.5