belliottsmith commented on code in PR #4362:
URL: https://github.com/apache/cassandra/pull/4362#discussion_r2326613170
##########
src/java/org/apache/cassandra/service/accord/txn/TxnUpdate.java:
##########
@@ -116,35 +116,38 @@ public ConditionalBlock deserialize(DataInputPlus in)
throws IOException
public void skip(DataInputPlus in) throws IOException
{
in.readUnsignedVInt32();
- skipWithVIntLength(in);
+ if (in.readBoolean())
+ skipWithVIntLength(in);
SerializePacked.skipPackedSortedIntsAndLength(in);
}
@Override
public long serializedSize(ConditionalBlock t)
{
long size = TypeSizes.sizeofUnsignedVInt(t.id);
- size += serializedSizeWithVIntLength(t.condition.bytes());
+ size += TypeSizes.sizeof(t.condition != null);
Review Comment:
Why is condition `nullable`? I don't believe we assign it anything non-null
in real codepaths, and I don't think we *should* either, since we have the
`None` condition (which takes up 1 byte rather than zero).
--
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]