Skip to content

Commit

Permalink
remove duplicate lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
MrQuansy committed Mar 22, 2024
1 parent 4c0aa7c commit e0b5af2
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,15 @@ public DictionaryEncoder() {

@Override
public void encode(Binary value, ByteArrayOutputStream out) {
entryIndex.computeIfAbsent(
value,
v -> {
indexEntry.add(v);
mapSize += v.getLength();
return entryIndex.size();
});
valuesEncoder.encode(entryIndex.get(value), out);
valuesEncoder.encode(
entryIndex.computeIfAbsent(
value,
v -> {
indexEntry.add(v);
mapSize += v.getLength();
return entryIndex.size();
}),
out);
}

@Override
Expand Down

0 comments on commit e0b5af2

Please sign in to comment.