Re: [JGIT PATCH] Support for delegating tree iterators
- From
Robin Rosenberg <robin.rosenberg.lists@dewire.com>
- Date
- Jul 2, 2009, 20:00 UTC
- Message-ID
- <200907022200.40179.robin.rosenberg.lists@dewire.com>
- In-Reply-To
- <1246470772-4496-1-git-send-email-constantine.plotnikov@gmail.com>
onsdag 01 juli 2009 19:52:52 skrev Constantine Plotnikov <constantine.plotnikov@gmail.com>:
Show 12 quoted lines
> + protected void ensurePathCapacity(final int capacity, final int len) {
> + if(path.length >= capacity) {
> + return;
> + }
> + final byte[] o = path;
> + int current = o.length;
> + int newCapacity = current;
> + while(newCapacity < capacity && newCapacity > 0) {
> + newCapacity <<= 1;
> + }
> + setPathCapacity(newCapacity, len);
> + }There are no JUnit tests that directly or indirectly proves this is working as only the optimized path is taken.
> + public int getNameLength() {
> + return pathLen - pathOffset;
> + }> + public void getName(byte[] buffer, int offset) {
> + System.arraycopy(path, pathOffset, buffer, offset, pathLen - pathOffset);
> + }Never used? Not even unit test code.
> -- robin