From e7ba63eaeb7afc41085d235da7a51bdbd2d641f1 Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Fri, 9 Aug 2019 13:25:00 +0300 Subject: [PATCH] vcs: cleanup - unify argument order GitOrigin-RevId: 0234c16d34323f8cea6aa6f985cfbfe5e810e40a --- .../openapi/vcs/changes/VcsDirtyScopeImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsDirtyScopeImpl.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsDirtyScopeImpl.java index ba85a08129fc..ed9ec534378e 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsDirtyScopeImpl.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsDirtyScopeImpl.java @@ -233,12 +233,12 @@ public class VcsDirtyScopeImpl extends VcsModifiableDirtyScope { private static boolean hasAncestor(@NotNull Set dirs, @NotNull FilePath filePath) { for (FilePath parent : dirs) { - if (isAncestor(filePath, parent)) return true; + if (isAncestor(parent, filePath)) return true; } return false; } - private static boolean isAncestor(@NotNull FilePath filePath, @NotNull FilePath parent) { + private static boolean isAncestor(@NotNull FilePath parent, @NotNull FilePath filePath) { return FileUtil.startsWith(filePath.getPath(), parent.getPath()); } @@ -267,7 +267,7 @@ public class VcsDirtyScopeImpl extends VcsModifiableDirtyScope { if (files != null) { for (Iterator it = files.iterator(); it.hasNext();) { FilePath oldBoy = it.next(); - if (isAncestor(oldBoy, newcomer)) { + if (isAncestor(newcomer, oldBoy)) { it.remove(); } } @@ -283,11 +283,11 @@ public class VcsDirtyScopeImpl extends VcsModifiableDirtyScope { else { for (Iterator it = dirsByRoot.iterator(); it.hasNext();) { FilePath oldBoy = it.next(); - if (isAncestor(newcomer, oldBoy)) { + if (isAncestor(oldBoy, newcomer)) { return; } - if (isAncestor(oldBoy, newcomer)) { + if (isAncestor(newcomer, oldBoy)) { it.remove(); } }