Fix off by one error in PackReverseIndex.

The last 32bit offset is at Integer.MAX_VALUE.

Change-Id: Idee8be3c7887e1d0c8339ff94aceff36dbf000db
This commit is contained in:
Colby Ranger 2013-02-20 22:59:35 -08:00
parent c033f016c9
commit 95ef1e83d0
1 changed files with 2 additions and 2 deletions

View File

@ -108,7 +108,7 @@ public PackReverseIndex(final PackIndex packIndex) {
int i64 = 0;
for (final MutableEntry me : index) {
final long o = me.getOffset();
if (o < Integer.MAX_VALUE)
if (o <= Integer.MAX_VALUE)
offsets32[i32++] = (int) o;
else
offsets64[i64++] = o;
@ -120,7 +120,7 @@ public PackReverseIndex(final PackIndex packIndex) {
int nth = 0;
for (final MutableEntry me : index) {
final long o = me.getOffset();
if (o < Integer.MAX_VALUE)
if (o <= Integer.MAX_VALUE)
nth32[Arrays.binarySearch(offsets32, (int) o)] = nth++;
else
nth64[Arrays.binarySearch(offsets64, o)] = nth++;