aweisberg commented on code in PR #3463:
URL: https://github.com/apache/cassandra/pull/3463#discussion_r1838578961


##########
src/java/org/apache/cassandra/service/accord/txn/AbstractKeySorted.java:
##########
@@ -55,16 +54,39 @@ public AbstractKeySorted(List<T> items)
         items.toArray(arr);
         Arrays.sort(arr, this::compare);
         this.items = arr;
-        validateOrder();
-        this.itemKeys = extractItemKeys();
+        int duplicates = validateOrder();
+        this.itemKeys = extractItemKeys(duplicates);
     }
 
-    private Keys extractItemKeys()
+    private Keys extractItemKeys(int duplicates)
     {
-        Key[] keys = new Key[size()];
-        for (int i = 0 ; i < keys.length ; ++i)
-            keys[i] = getKey(items[i]);
-        return Keys.ofSorted(keys);
+        PartitionKey[] partitionKeys = new PartitionKey[items.length - 
duplicates];

Review Comment:
   Fixed by making `AbstractKeysSorted` extend `AbstractList` so that the 
transforming version of `Keys.of` can be used.



-- 
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