From deb9c13b9fc58d880408e08b6e4c8e4d0b9c9f5b Mon Sep 17 00:00:00 2001 From: Raunaq Morarka Date: Sat, 20 Jun 2020 18:52:22 +0530 Subject: [PATCH] Use getInt to access IntArrayList --- .../java/io/prestosql/operator/aggregation/TypedSet.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/presto-main/src/main/java/io/prestosql/operator/aggregation/TypedSet.java b/presto-main/src/main/java/io/prestosql/operator/aggregation/TypedSet.java index 74de2c561829c..fecbcb9562a69 100644 --- a/presto-main/src/main/java/io/prestosql/operator/aggregation/TypedSet.java +++ b/presto-main/src/main/java/io/prestosql/operator/aggregation/TypedSet.java @@ -122,7 +122,7 @@ public boolean contains(Block block, int position) return containsNullElement; } else { - return blockPositionByHash.get(getHashPositionOfElement(block, position)) != EMPTY_SLOT; + return blockPositionByHash.getInt(getHashPositionOfElement(block, position)) != EMPTY_SLOT; } } @@ -137,7 +137,7 @@ public void add(Block block, int position) } int hashPosition = getHashPositionOfElement(block, position); - if (blockPositionByHash.get(hashPosition) == EMPTY_SLOT) { + if (blockPositionByHash.getInt(hashPosition) == EMPTY_SLOT) { addNewElement(hashPosition, block, position); } } @@ -149,7 +149,7 @@ public int size() public int positionOf(Block block, int position) { - return blockPositionByHash.get(getHashPositionOfElement(block, position)); + return blockPositionByHash.getInt(getHashPositionOfElement(block, position)); } /** @@ -159,7 +159,7 @@ private int getHashPositionOfElement(Block block, int position) { int hashPosition = getMaskedHash(hashPosition(elementType, block, position)); while (true) { - int blockPosition = blockPositionByHash.get(hashPosition); + int blockPosition = blockPositionByHash.getInt(hashPosition); if (blockPosition == EMPTY_SLOT) { // Doesn't have this element return hashPosition;