michaeljmarshall commented on code in PR #4353:
URL: https://github.com/apache/cassandra/pull/4353#discussion_r2674126427


##########
src/java/org/apache/cassandra/utils/CloseableIterator.java:
##########
@@ -17,14 +17,29 @@
  */
 package org.apache.cassandra.utils;
 
+import java.io.Closeable;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
 
+import org.apache.cassandra.io.util.FileUtils;
+
 // so we can instantiate anonymous classes implementing both interfaces
 public interface CloseableIterator<T> extends Iterator<T>, AutoCloseable
 {
     public void close();
 
+    CloseableIterator<Object> EMPTY = 
CloseableIterator.wrap(Collections.emptyIterator());
+
+    /**
+     * Returns an empty {@link CloseableIterator}.
+     */
+    @SuppressWarnings("unchecked")
+    static <T> CloseableIterator<T> emptyIterator()
+    {
+        return (CloseableIterator<T>) EMPTY;
+    }

Review Comment:
   Yes, but I think we should remove this method. It isn't used on the typical 
hot path.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to