]> source.dussan.org Git - jgit.git/commit
TemporaryBuffer: Clear block pointer list instead of reallocating 27/44127/3
authorDave Borowitz <dborowitz@google.com>
Wed, 18 Mar 2015 19:51:40 +0000 (12:51 -0700)
committerDave Borowitz <dborowitz@google.com>
Wed, 18 Mar 2015 20:38:58 +0000 (13:38 -0700)
commite3e9e1f003b09a35048e0c30f8a77c66dcfdda32
treef33d531498383fedd60313ba459556584940c366
parentedf4368b0c29e25bb74ec0e8f12070582a580eea
TemporaryBuffer: Clear block pointer list instead of reallocating

The block pointer list may have been relatively large, so no need to
make more garbage. Instead, just clear the list and null out all the
elements.

Another possible motivation: a caller may have provided an inaccurate
estimated size, so the list might have been resized several times. If
the list is reused later for a similarly underestimated workload, this
fix will prevent additional resizing on subsequent usages.

Change-Id: I511675035dcff1117381a46c294cc11aded10893
org.eclipse.jgit/src/org/eclipse/jgit/util/TemporaryBuffer.java