From 816596be8c942461313284b239652980bd9d908b Mon Sep 17 00:00:00 2001 From: James Petty Date: Wed, 20 Oct 2021 10:47:34 -0400 Subject: [PATCH] Remove size() method from PositionLinks --- .../io/trino/operator/join/ArrayPositionLinks.java | 4 ++-- .../java/io/trino/operator/join/PositionLinks.java | 10 +--------- .../io/trino/operator/join/SortedPositionLinks.java | 4 ++-- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/core/trino-main/src/main/java/io/trino/operator/join/ArrayPositionLinks.java b/core/trino-main/src/main/java/io/trino/operator/join/ArrayPositionLinks.java index 1d042403a23b..0dacd0965e3c 100644 --- a/core/trino-main/src/main/java/io/trino/operator/join/ArrayPositionLinks.java +++ b/core/trino-main/src/main/java/io/trino/operator/join/ArrayPositionLinks.java @@ -69,9 +69,9 @@ public long checksum() } @Override - public int size() + public boolean isEmpty() { - return size; + return size == 0; } } diff --git a/core/trino-main/src/main/java/io/trino/operator/join/PositionLinks.java b/core/trino-main/src/main/java/io/trino/operator/join/PositionLinks.java index 6a7cba713861..3cf6ae886fe4 100644 --- a/core/trino-main/src/main/java/io/trino/operator/join/PositionLinks.java +++ b/core/trino-main/src/main/java/io/trino/operator/join/PositionLinks.java @@ -48,15 +48,7 @@ interface FactoryBuilder Factory build(); - /** - * @return number of linked elements - */ - int size(); - - default boolean isEmpty() - { - return size() == 0; - } + boolean isEmpty(); } interface Factory diff --git a/core/trino-main/src/main/java/io/trino/operator/join/SortedPositionLinks.java b/core/trino-main/src/main/java/io/trino/operator/join/SortedPositionLinks.java index 6a645bf0b245..c57ef8df722d 100644 --- a/core/trino-main/src/main/java/io/trino/operator/join/SortedPositionLinks.java +++ b/core/trino-main/src/main/java/io/trino/operator/join/SortedPositionLinks.java @@ -135,9 +135,9 @@ public Factory build() } @Override - public int size() + public boolean isEmpty() { - return positionLinks.size(); + return positionLinks.isEmpty(); } // Separate static method to avoid embedding references to "this"