]> source.dussan.org Git - jgit.git/commit
PackBitmapIndexBuilder: allow repeated call of getCompressedBitmaps() 33/1188433/5
authorSam Delmerico <delmerico@google.com>
Wed, 27 Mar 2024 19:09:42 +0000 (12:09 -0700)
committerIvan Frade <ifrade@google.com>
Tue, 2 Apr 2024 20:28:22 +0000 (20:28 +0000)
commite118d4382358e2258703b4f3d96d29254b8e5279
tree8e6c157dbad72046c1b54c06b87cdcc4765384f6
parent82b224c0d109d4debe765f7c2ee5f220694eca58
PackBitmapIndexBuilder: allow repeated call of getCompressedBitmaps()

Each call of the current implementation of
PackBitmapIndexBuilder.getCompressedBitmaps reverses the class member that is returned. So two subsequent calls of this function will
receive reversed structures.

Instead we should just reverse a copy of the structure. This way the
PackBitmapIndexBuilder can continue to efficiently accept new bitmaps
via processBitmapForWrite (because we can continue to add to the back of
the bitmapsToWrite ArrayList) while ensuring that the bitmaps are
returned in the correct ordering from getCompressedBitmaps.

Change-Id: If7364222b9e62920c0c2c06894716fe85dd13315
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackBitmapIndexBuilder.java