Skip to content

Commit

Permalink
PARQUET-2394: Use computeIfAbsent in MessageColumnIO (apache#1217)
Browse files Browse the repository at this point in the history
* PARQUET-2394: Use `computeIfAbsent` in `MessageColumnIO`

* Fix identation
  • Loading branch information
Fokko authored Dec 4, 2023
1 parent 44b5622 commit 3df625e
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,7 @@ private void buildGroupToLeafWriterMap(PrimitiveColumnIO primitive, ColumnWriter
}

private List<ColumnWriter> getLeafWriters(GroupColumnIO group) {
List<ColumnWriter> writers = groupToLeafWriter.get(group);
if (writers == null) {
writers = new ArrayList<>();
groupToLeafWriter.put(group, writers);
}
return writers;
return groupToLeafWriter.computeIfAbsent(group, k -> new ArrayList<>());
}

public MessageColumnIORecordConsumer(ColumnWriteStore columns) {
Expand Down

0 comments on commit 3df625e

Please sign in to comment.