Skip to content

Commit

Permalink
Use Collection.isEmpty
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Jan 11, 2024
1 parent e61fd89 commit 373aa94
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public Page adaptPage(@Nullable Page input)

private static Block createAdaptedLazyBlock(Block inputBlock, List<Integer> dereferenceSequence)
{
if (dereferenceSequence.size() == 0) {
if (dereferenceSequence.isEmpty()) {
return inputBlock;
}

Expand Down Expand Up @@ -129,7 +129,7 @@ public Block load()
*/
private Block loadInternalBlock(List<Integer> dereferences, Block parentBlock)
{
if (dereferences.size() == 0) {
if (dereferences.isEmpty()) {
return parentBlock.getLoadedBlock();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public AsyncQueue(int targetQueueSize, Executor executor)
*/
public synchronized boolean isFinished()
{
return finishing && borrowerCount == 0 && elements.size() == 0;
return finishing && borrowerCount == 0 && elements.isEmpty();
}

public synchronized void finish()
Expand All @@ -83,7 +83,7 @@ public synchronized void finish()
private synchronized void signalIfFinishing()
{
if (finishing && borrowerCount == 0) {
if (elements.size() == 0) {
if (elements.isEmpty()) {
// Reset elements queue after finishing to avoid holding on to the full sized empty array inside
elements = new ArrayDeque<>(0);
completeAsync(executor, notEmptySignal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static HiveColumnHandle createProjectedColumnHandle(HiveColumnHandle colu
{
checkArgument(column.isBaseColumn(), "base column is expected here");

if (indices.size() == 0) {
if (indices.isEmpty()) {
return column;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ private static void verifyBlock(Block actualBlock, Type outputType, Block input,

private static Block createProjectedColumnBlock(Block data, Type finalType, RowType blockType, List<Integer> dereferences)
{
if (dereferences.size() == 0) {
if (dereferences.isEmpty()) {
return data;
}

Expand Down

0 comments on commit 373aa94

Please sign in to comment.