: discardTail(cf, toDiscard, newCf, cf.iterator(), tester);
}
private int discardHead(ColumnFamily cf, int toDiscard, ColumnFamily copy, Iterator<Column> iter, DeletionInfo.InOrderTester tester)
{
ColumnCounter counter = columnCounter();
// Discard the first 'toDiscard' live
while (iter.hasNext())
{
Column c = iter.next();
counter.count(c, tester);
if (counter.live() > toDiscard)
{
copy.addColumn(c);
while (iter.hasNext())
copy.addColumn(iter.next());
}
}
return Math.min(counter.live(), toDiscard);
}