diff options
author | Christian Halstrick <christian.halstrick@gmail.com> | 2010-09-02 07:46:50 -0400 |
---|---|---|
committer | Code Review <codereview-daemon@eclipse.org> | 2010-09-02 07:46:50 -0400 |
commit | f7f7c55bcaa01fbe4491f028a31fc85387fa8694 (patch) | |
tree | 7da0983b24d89572c41e3843af6065630a12145b /org.eclipse.jgit | |
parent | 7a504b8d7cf7a329774993ea94776a76886e4017 (diff) | |
parent | 3fa7d3a2d22c3f6e1b800955e7e2bc5ad3df80c4 (diff) | |
download | jgit-f7f7c55bcaa01fbe4491f028a31fc85387fa8694.tar.gz jgit-f7f7c55bcaa01fbe4491f028a31fc85387fa8694.zip |
Merge "Use int[] rather than IntList for RawText hashes"
Diffstat (limited to 'org.eclipse.jgit')
5 files changed, 9 insertions, 11 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java index 4befe586c3..ad81de58c9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawText.java @@ -95,7 +95,7 @@ public class RawText implements Sequence { protected final IntList lines; /** Hash code for each line, for fast equality elimination. */ - protected final IntList hashes; + protected final int[] hashes; /** * Create a new sequence from an existing content byte array. @@ -140,7 +140,7 @@ public class RawText implements Sequence { private static boolean equals(final RawText a, final int ai, final RawText b, final int bi) { - if (a.hashes.get(ai) != b.hashes.get(bi)) + if (a.hashes[ai] != b.hashes[bi]) return false; int as = a.lines.get(ai); @@ -197,15 +197,13 @@ public class RawText implements Sequence { return content[end - 1] != '\n'; } - private IntList computeHashes() { - final IntList r = new IntList(lines.size()); - r.add(0); + private int[] computeHashes() { + final int[] r = new int[lines.size()]; for (int lno = 1; lno < lines.size() - 1; lno++) { final int ptr = lines.get(lno); final int end = lines.get(lno + 1); - r.add(hashLine(content, ptr, end)); + r[lno] = hashLine(content, ptr, end); } - r.add(0); return r; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextIgnoreAllWhitespace.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextIgnoreAllWhitespace.java index 211618a3fb..855a872428 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextIgnoreAllWhitespace.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextIgnoreAllWhitespace.java @@ -79,7 +79,7 @@ public class RawTextIgnoreAllWhitespace extends RawText { private static boolean equals(final RawText a, final int ai, final RawText b, final int bi) { - if (a.hashes.get(ai) != b.hashes.get(bi)) + if (a.hashes[ai] != b.hashes[bi]) return false; int as = a.lines.get(ai); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextIgnoreLeadingWhitespace.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextIgnoreLeadingWhitespace.java index 23778973b7..df4805a4c8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextIgnoreLeadingWhitespace.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextIgnoreLeadingWhitespace.java @@ -78,7 +78,7 @@ public class RawTextIgnoreLeadingWhitespace extends RawText { private static boolean equals(final RawText a, final int ai, final RawText b, final int bi) { - if (a.hashes.get(ai) != b.hashes.get(bi)) + if (a.hashes[ai] != b.hashes[bi]) return false; int as = a.lines.get(ai); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextIgnoreTrailingWhitespace.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextIgnoreTrailingWhitespace.java index 3feb2e783a..5e69eaabd7 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextIgnoreTrailingWhitespace.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextIgnoreTrailingWhitespace.java @@ -78,7 +78,7 @@ public class RawTextIgnoreTrailingWhitespace extends RawText { private static boolean equals(final RawText a, final int ai, final RawText b, final int bi) { - if (a.hashes.get(ai) != b.hashes.get(bi)) + if (a.hashes[ai] != b.hashes[bi]) return false; int as = a.lines.get(ai); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextIgnoreWhitespaceChange.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextIgnoreWhitespaceChange.java index e6bd8e98b7..2d1b9772fe 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextIgnoreWhitespaceChange.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/RawTextIgnoreWhitespaceChange.java @@ -81,7 +81,7 @@ public class RawTextIgnoreWhitespaceChange extends RawText { private static boolean equals(final RawText a, final int ai, final RawText b, final int bi) { - if (a.hashes.get(ai) != b.hashes.get(bi)) + if (a.hashes[ai] != b.hashes[bi]) return false; int as = a.lines.get(ai); |