From ce602d53a66e53a15047cf463cbb4167e2cf51a0 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Sun, 5 Aug 2012 12:35:46 +0400 Subject: [PATCH] Declare constant instead of using a magic number --- plugins/git4idea/src/git4idea/roots/GitRootDetector.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/git4idea/src/git4idea/roots/GitRootDetector.java b/plugins/git4idea/src/git4idea/roots/GitRootDetector.java index be64b8f810ea..f1283d6e89ee 100644 --- a/plugins/git4idea/src/git4idea/roots/GitRootDetector.java +++ b/plugins/git4idea/src/git4idea/roots/GitRootDetector.java @@ -41,6 +41,8 @@ import java.util.Set; */ public class GitRootDetector { + private static final int MAXIMUM_SCAN_DEPTH = 2; + @NotNull private final Project myProject; @NotNull private final PlatformFacade myPlatformFacade; @@ -90,7 +92,7 @@ public class GitRootDetector { @NotNull private Set scanForRootsInsideDir(@NotNull final VirtualFile dir, final int depth) { final Set roots = new HashSet(); - if (depth > 2) { + if (depth > MAXIMUM_SCAN_DEPTH) { // performance optimization via limitation: don't scan deep though the whole VFS, 2 levels under a content root is enough return roots; }