コード例 #1
0
 /**
  * Check if the current entry of both iterators has the same id.
  *
  * <p>This method is faster than {@link #getEntryObjectId()} as it does not require copying the
  * bytes out of the buffers. A direct {@link #idBuffer} compare operation is performed.
  *
  * @param otherIterator the other iterator to test against.
  * @return true if both iterators have the same object id; false otherwise.
  */
 public boolean idEqual(final AbstractTreeIterator otherIterator) {
   return ObjectId.equals(
       idBuffer(), idOffset(), otherIterator.idBuffer(), otherIterator.idOffset());
 }
コード例 #2
0
 /**
  * Set path buffer capacity to the specified size
  *
  * @param capacity the new size
  * @param len the amount of bytes to copy
  */
 private void setPathCapacity(int capacity, int len) {
   final byte[] o = path;
   final byte[] n = new byte[capacity];
   System.arraycopy(o, 0, n, 0, len);
   for (AbstractTreeIterator p = this; p != null && p.path == o; p = p.parent) p.path = n;
 }