|
|
@ -44,6 +44,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
package org.eclipse.jgit.util; |
|
|
|
package org.eclipse.jgit.util; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
|
|
|
|
|
|
|
|
/** A more efficient List<Long> using a primitive long array. */ |
|
|
|
/** A more efficient List<Long> using a primitive long array. */ |
|
|
|
public class LongList { |
|
|
|
public class LongList { |
|
|
|
private long[] entries; |
|
|
|
private long[] entries; |
|
|
@ -146,6 +148,11 @@ public class LongList { |
|
|
|
add(val); |
|
|
|
add(val); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Sort the list of longs according to their natural ordering. */ |
|
|
|
|
|
|
|
public void sort() { |
|
|
|
|
|
|
|
Arrays.sort(entries, 0, count); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void grow() { |
|
|
|
private void grow() { |
|
|
|
final long[] n = new long[(entries.length + 16) * 3 / 2]; |
|
|
|
final long[] n = new long[(entries.length + 16) * 3 / 2]; |
|
|
|
System.arraycopy(entries, 0, n, 0, count); |
|
|
|
System.arraycopy(entries, 0, n, 0, count); |
|
|
|