(coded-sequence) Reduce allocations in GCS.values()

This commit is contained in:
Viktor Lofgren 2024-08-25 12:06:31 +02:00
parent 3fb3c0b92e
commit 6dda2c2d83

View File

@ -93,8 +93,8 @@ public class GammaCodedSequence implements Iterable<Integer>, CodedSequence {
}
public IntList values() {
var intItr = iterator();
IntArrayList ret = new IntArrayList(8);
var intItr = new EliasGammaSequenceIterator(buffer());
IntArrayList ret = new IntArrayList(intItr.rem);
while (intItr.hasNext()) {
ret.add(intItr.nextInt());
}