cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1041027 - /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamily.java
Date Wed, 01 Dec 2010 14:45:51 GMT
Author: jbellis
Date: Wed Dec  1 14:45:51 2010
New Revision: 1041027

URL: http://svn.apache.org/viewvc?rev=1041027&view=rev
Log:
replace loop over keys + lookup w/ loop over map entries
patch by Dave Brosius; reviewed by jbellis for CASSANDRA-1794

Modified:
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamily.java

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamily.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamily.java?rev=1041027&r1=1041026&r2=1041027&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamily.java (original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamily.java Wed
Dec  1 14:45:51 2010
@@ -24,7 +24,6 @@ import java.security.NoSuchAlgorithmExce
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.Set;
 import java.util.SortedSet;
 import java.util.concurrent.ConcurrentSkipListMap;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -302,11 +301,11 @@ public class ColumnFamily implements ICo
         // the delete tombstone, since cfNew was generated by CF.resolve, which
         // takes care of those for us.)
         Map<ByteBuffer, IColumn> columns = cfComposite.getColumnsMap();
-        Set<ByteBuffer> cNames = columns.keySet();
-        for (ByteBuffer cName : cNames)
+        for (Map.Entry<ByteBuffer, IColumn> entry : columns.entrySet())
         {
+            ByteBuffer cName = entry.getKey();
             IColumn columnInternal = this.columns.get(cName);
-            IColumn columnExternal = columns.get(cName);
+            IColumn columnExternal = entry.getValue();
             if (columnInternal == null)
             {
                 cfDiff.addColumn(columnExternal);



Mime
View raw message