mike-tr-adamson commented on code in PR #2498:
URL: https://github.com/apache/cassandra/pull/2498#discussion_r1272500823


##########
src/java/org/apache/cassandra/index/sai/utils/PrimaryKey.java:
##########
@@ -92,25 +93,17 @@ abstract class AbstractPrimaryKey implements PrimaryKey
         {
             public ByteSource asComparableBytes(ByteComparable.Version version)
             {
-                ByteSource tokenComparable = 
token().asComparableBytes(version);
-                if (partitionKey() == null)
-                    return ByteSource.withTerminator(version == 
ByteComparable.Version.LEGACY ? ByteSource.END_OF_STREAM
-                                                                               
               : ByteSource.TERMINATOR,
-                                                     tokenComparable,
-                                                     null,
-                                                     null);
                 ByteSource keyComparable = 
ByteSource.of(partitionKey().getKey(), version);
+                if (clusteringComparator.size() == 0)
+                    return keyComparable;
                 // It is important that the 
ClusteringComparator.asBytesComparable method is used
                 // to maintain the correct clustering sort order
-                ByteSource clusteringComparable = clusteringComparator == null 
||
-                                                  clusteringComparator.size() 
== 0 ||
-                                                  clustering() == null ||
+                ByteSource clusteringComparable = clustering() == null ||
                                                   clustering().isEmpty() ? null

Review Comment:
   I have fixed these by adding `@SuppressWarnings("ConstantConditions")`.



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