You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jm...@apache.org on 2015/09/24 23:49:46 UTC

[02/12] cassandra git commit: Properly test for empty static row

Properly test for empty static row

UnfilteredRowIterators.noRowsIterator() was testing the staticRow
against null to avoid allocating an empty Columns object, but we never
use null for empty static rows, we use Rows.EMPTY_STATIC_ROW so the
branch was never taken. This is a trivial fix to avoid that allocation.


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/32d76168
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/32d76168
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/32d76168

Branch: refs/heads/trunk
Commit: 32d7616846cb02b89fdecd087e6fbdf53e50fcb2
Parents: 53dc42d
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Thu Sep 24 10:02:53 2015 -0700
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Thu Sep 24 10:08:17 2015 -0700

----------------------------------------------------------------------
 .../org/apache/cassandra/db/rows/UnfilteredRowIterators.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/32d76168/src/java/org/apache/cassandra/db/rows/UnfilteredRowIterators.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/rows/UnfilteredRowIterators.java b/src/java/org/apache/cassandra/db/rows/UnfilteredRowIterators.java
index e251670..22628e2 100644
--- a/src/java/org/apache/cassandra/db/rows/UnfilteredRowIterators.java
+++ b/src/java/org/apache/cassandra/db/rows/UnfilteredRowIterators.java
@@ -99,8 +99,8 @@ public abstract class UnfilteredRowIterators
      */
     public static UnfilteredRowIterator noRowsIterator(final CFMetaData cfm, final DecoratedKey partitionKey, final Row staticRow, final DeletionTime partitionDeletion, final boolean isReverseOrder)
     {
-        PartitionColumns columns = staticRow == null ? PartitionColumns.NONE
-                                                     : new PartitionColumns(Columns.from(staticRow.columns()), Columns.NONE);
+        PartitionColumns columns = staticRow == Rows.EMPTY_STATIC_ROW ? PartitionColumns.NONE
+                                                                      : new PartitionColumns(Columns.from(staticRow.columns()), Columns.NONE);
         return new UnfilteredRowIterator()
         {
             public CFMetaData metadata()