]> source.dussan.org Git - jgit.git/commitdiff
GC: Simplify lambda 84/116784/1
authorHector Caballero <hector.caballero@ericsson.com>
Tue, 30 Jan 2018 01:24:23 +0000 (20:24 -0500)
committerHector Caballero <hector.caballero@ericsson.com>
Tue, 6 Feb 2018 11:28:10 +0000 (06:28 -0500)
filter() stream operation also accepts a lambda expression.

Signed-off-by: Hector Oswaldo Caballero <hector.caballero@ericsson.com>
Change-Id: Ie0b7fe43d39593172969fd16c3e44b49bac27306

org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java

index 2be38b980ee8816832f264c53fba99fdb3ab35c5..75b0f0b25b783889eac0c3849bd273778c18c241 100644 (file)
@@ -931,11 +931,10 @@ public class GC {
                List<String> fileNames = null;
                try (Stream<Path> 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