From 856972e4da233a64ba028ef467a6e86973f2d4ea Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Tue, 9 Feb 2016 17:16:14 +0000 Subject: [PATCH] Refactor --- source/net/filebot/cli/CmdlineOperations.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source/net/filebot/cli/CmdlineOperations.java b/source/net/filebot/cli/CmdlineOperations.java index 87303a34..037c9a8b 100644 --- a/source/net/filebot/cli/CmdlineOperations.java +++ b/source/net/filebot/cli/CmdlineOperations.java @@ -679,12 +679,10 @@ public class CmdlineOperations implements CmdlineInterface { } private static File nextAvailableIndexedName(File file) { - IntStream seq = IntStream.range(1, 100); - File parent = file.getParentFile(); String name = getName(file); String ext = getExtension(file); - return seq.mapToObj(i -> new File(parent, name + '.' + i + '.' + ext)).filter(f -> !f.exists()).findFirst().get(); + return IntStream.range(1, 100).mapToObj(i -> new File(parent, name + '.' + i + '.' + ext)).filter(f -> !f.exists()).findFirst().get(); } @Override