From d060c2f5c27947a7b647d977fbf2c4dbf7a2b69f Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Sun, 29 May 2016 20:18:40 +0300 Subject: [PATCH] simplify to lambda, and don't wrap into new File() --- .../src/git4idea/status/GitChangesCollector.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/plugins/git4idea/src/git4idea/status/GitChangesCollector.java b/plugins/git4idea/src/git4idea/status/GitChangesCollector.java index 73904e2f97f4..435cf9621cc2 100644 --- a/plugins/git4idea/src/git4idea/status/GitChangesCollector.java +++ b/plugins/git4idea/src/git4idea/status/GitChangesCollector.java @@ -26,10 +26,10 @@ import com.intellij.openapi.vcs.changes.ChangeListManager; import com.intellij.openapi.vcs.changes.ContentRevision; import com.intellij.openapi.vcs.changes.VcsDirtyScope; import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.util.containers.ContainerUtil; import com.intellij.vcsUtil.VcsUtil; import org.jetbrains.annotations.NotNull; -import java.io.File; import java.util.*; /** @@ -108,12 +108,7 @@ abstract class GitChangesCollector { removeCommonParents(allPaths); - final List paths = new ArrayList(allPaths.size()); - for (String p : allPaths) { - final File file = new File(p); - paths.add(VcsUtil.getFilePath(file)); - } - return paths; + return ContainerUtil.map(allPaths, VcsUtil::getFilePath); } protected void addToPaths(FilePath pathToAdd, List paths) {