From da2cb0242279b81f24b2bde86c6896acc05dd47d Mon Sep 17 00:00:00 2001 From: Robert Yokota Date: Thu, 3 Aug 2017 13:37:45 +0800 Subject: [PATCH] HBASE-16893 Use Collection.removeIf instead of Iterator.remove in DependentColumnFilter Signed-off-by: Chia-Ping Tsai --- .../hadoop/hbase/filter/DependentColumnFilter.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java index 5717fc4f63e..90d00ddbdfd 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/DependentColumnFilter.java @@ -21,7 +21,6 @@ package org.apache.hadoop.hbase.filter; import java.io.IOException; import java.util.ArrayList; import java.util.HashSet; -import java.util.Iterator; import java.util.List; import java.util.Set; @@ -153,14 +152,7 @@ public class DependentColumnFilter extends CompareFilter { @Override public void filterRowCells(List kvs) { - Iterator it = kvs.iterator(); - Cell kv; - while(it.hasNext()) { - kv = it.next(); - if(!stampSet.contains(kv.getTimestamp())) { - it.remove(); - } - } + kvs.removeIf(kv -> !stampSet.contains(kv.getTimestamp())); } @Override