maedhroz commented on code in PR #3926:
URL: https://github.com/apache/cassandra/pull/3926#discussion_r1972496473


##########
src/java/org/apache/cassandra/utils/btree/AbstractBTreeMap.java:
##########
@@ -106,12 +108,27 @@ public Set<K> keySet()
     }
 
     @Override
-    public Set<V> values()
+    public Collection<V> values()
     {
-        ImmutableSet.Builder<V> b = ImmutableSet.builder();
-        for (Map.Entry<K, V> e : entrySet())
-            b.add(e.getValue());
-        return b.build();
+        // java.util.Map.values docstring says:
+        // > Returns a Collection view of the values contained in this map. 
The collection is backed by the map, so
+        // > changes to the map are reflected in the collection, and 
vice-versa.
+        // This implementation more closely mirrors the 
java.util.AbstractMap.values implementation, which returns an
+        // AbstractCollection as well.
+        return new AbstractCollection<V>()

Review Comment:
   nit: Technically you don't need the `V` and it could just be `<>`



-- 
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: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to