frankgh commented on code in PR #4709:
URL: https://github.com/apache/cassandra/pull/4709#discussion_r3066230516


##########
src/java/org/apache/cassandra/db/ReadCommand.java:
##########
@@ -644,12 +644,15 @@ public Row applyToStatic(Row row)
             public Row applyToRow(Row row)
             {
                 boolean hasTombstones = false;
-                for (Cell<?> cell : row.cells())
+                if (row.hasDeletion(ReadCommand.this.nowInSec())) // perf 
optimization, to avoid iteration if all cells are alive

Review Comment:
   Minor NIT, can we extract both `nowInSec` and `rowHasDeletion` into 
variables and reuse the values to avoid calling `ReadCommand.this.nowInSec();` 
and `row.hasDeletion(nowInSec)` more than one time?
   
   ```suggestion
                   long nowInSec = ReadCommand.this.nowInSec();
                   boolean rowHasDeletion = row.hasDeletion(nowInSec);
                   if (rowHasDeletion) // perf optimization, to avoid iteration 
if all cells are alive
   ```



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