summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-12-07 18:27:59 -0800
committerShawn O. Pearce <spearce@spearce.org>2010-12-08 10:03:20 -0800
commitf4e9c8890cc625ba57b5a3cd078ca14cbcc86f8b (patch)
tree9a4bc513b883b1bf6d6a526b7ad6d9813362ec58 /org.eclipse.jgit
parent11fd0fe03ae471d1a6528070b4fee884b0ffea1d (diff)
downloadjgit-f4e9c8890cc625ba57b5a3cd078ca14cbcc86f8b.tar.gz
jgit-f4e9c8890cc625ba57b5a3cd078ca14cbcc86f8b.zip
IndexDiff: Simplify allocation of filter list
We add either 3 or 4 filters. If we are adding only 3 filters, allocating the array for 4 isn't a huge waste of memory, but it does simplify our code. Change-Id: I7df29b414f6d5cfcf533edb1405083e6fcec32cf Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
index d0ef337035..a65753d1c9 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/IndexDiff.java
@@ -177,8 +177,7 @@ public class IndexDiff {
treeWalk.addTree(new EmptyTreeIterator());
treeWalk.addTree(new DirCacheIterator(dirCache));
treeWalk.addTree(initialWorkingTreeIterator);
- Collection<TreeFilter> filters = new ArrayList<TreeFilter>(
- filter == null ? 3 : 4);
+ Collection<TreeFilter> filters = new ArrayList<TreeFilter>(4);
if (filter != null)
filters.add(filter);
filters.add(new NotIgnoredFilter(WORKDIR));