Permalink
Browse files

simply: no need for iterator to get first item in List

  • Loading branch information...
1 parent b730e5f commit 572d328762bee9100549963a6826fdb9f633af2a @mebigfatguy mebigfatguy committed Mar 9, 2014
View
2 src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
@@ -71,7 +71,7 @@ public void addUpdateForKey(ColumnFamily cf, ByteBuffer key, Composite prefix, U
if (cfm.comparator.isDense())
{
if (prefix.isEmpty())
- throw new InvalidRequestException(String.format("Missing PRIMARY KEY part %s", cfm.clusteringColumns().iterator().next()));
+ throw new InvalidRequestException(String.format("Missing PRIMARY KEY part %s", cfm.clusteringColumns().get(0)));
// An empty name for the compact value is what we use to recognize the case where there is not column
// outside the PK, see CreateStatement.
View
4 test/unit/org/apache/cassandra/db/RowIterationTest.java
@@ -82,7 +82,7 @@ public void testRowIterationDeletionTime()
rm.apply();
store.forceBlockingFlush();
- ColumnFamily cf = Util.getRangeSlice(store).iterator().next().cf;
+ ColumnFamily cf = Util.getRangeSlice(store).get(0).cf;
assert cf.deletionInfo().equals(delInfo2);
}
@@ -100,7 +100,7 @@ public void testRowIterationDeletion()
rm.apply();
store.forceBlockingFlush();
- ColumnFamily cf = Util.getRangeSlice(store).iterator().next().cf;
+ ColumnFamily cf = Util.getRangeSlice(store).get(0).cf;
assert cf != null;
}
}
View
2 test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
@@ -201,7 +201,7 @@ public void testGetPositionsForRangesWithKeyCache() throws ExecutionException, I
long p6 = sstable.getPosition(k(6), SSTableReader.Operator.EQ).position;
long p7 = sstable.getPosition(k(7), SSTableReader.Operator.EQ).position;
- Pair<Long, Long> p = sstable.getPositionsForRanges(makeRanges(t(2), t(6))).iterator().next();
+ Pair<Long, Long> p = sstable.getPositionsForRanges(makeRanges(t(2), t(6))).get(0);
// range are start exclusive so we should start at 3
assert p.left == p3;

0 comments on commit 572d328

Please sign in to comment.