Browse Source

Merge "Improve the documentation of the ByteArraySet used by PathFilterGroup"

stable-3.0
Shawn Pearce 12 years ago committed by Gerrit Code Review @ Eclipse.org
parent
commit
178d55c24d
  1. 16
      org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/ByteArraySet.java

16
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/ByteArraySet.java

@ -53,6 +53,10 @@ import org.eclipse.jgit.util.RawParseUtils;
* {@link PathFilterGroup.Group}. Most methods assume the hash is already know * {@link PathFilterGroup.Group}. Most methods assume the hash is already know
* and therefore requires the caller to supply it beforehand. The implementation * and therefore requires the caller to supply it beforehand. The implementation
* is a loose derivative of ObjectIdSubclassMap. * is a loose derivative of ObjectIdSubclassMap.
* <p>
* The class is only intended for use by PathFilterGroup.
* <p>
* The arrays stored may not be changed after adding.
*/ */
class ByteArraySet { class ByteArraySet {
@ -87,11 +91,11 @@ class ByteArraySet {
return null; return null;
} }
private static boolean equals(byte[] a, byte[] b, int length) { private static boolean equals(byte[] storedObj, byte[] toFind, int length) {
if (a.length != length || b.length < length) if (storedObj.length != length || toFind.length < length)
return false; return false;
for (int i = 0; i < length; ++i) { for (int i = 0; i < length; ++i) {
if (a[i] != b[i]) if (storedObj[i] != toFind[i])
return false; return false;
} }
return true; return true;
@ -125,7 +129,8 @@ class ByteArraySet {
* </pre> * </pre>
* *
* @param newValue * @param newValue
* the array to store. * the array to store by reference if the length is the same as
* the length parameter
* @param length * @param length
* The number of bytes in newValue that are used * The number of bytes in newValue that are used
* @param hash * @param hash
@ -246,6 +251,9 @@ class ByteArraySet {
return -1; return -1;
} }
/**
* An incremental hash function.
*/
static class Hasher { static class Hasher {
private int hash; private int hash;

Loading…
Cancel
Save