tolbertam commented on code in PR #1620:
URL:
https://github.com/apache/cassandra-java-driver/pull/1620#discussion_r1732022403
##########
core/src/main/java/com/datastax/oss/driver/internal/core/cql/DefaultBoundStatement.java:
##########
@@ -358,7 +358,7 @@ public ByteBuffer getRoutingKey() {
if (indices.isEmpty()) {
return null;
} else if (indices.size() == 1) {
- return getBytesUnsafe(indices.get(0));
+ return isSet(0) ? getBytesUnsafe(indices.get(0)) : null;
Review Comment:
this exactly ^. On initial look, I came to the same conclusion and felt
that you could even just delete this branch and fall into the else and the
behavior matches this change exactly, but I think this branch sort of exists as
an optimization (avoids creating an array), so :+1: to accept your change as it
is.
--
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]