MinTimeFirehose: Care less about making nextRow work without hasMore

This commit is contained in:
Gian Merlino 2013-04-19 16:57:20 -07:00
parent 7da1466340
commit 78850a0706
1 changed files with 3 additions and 14 deletions

View File

@ -44,20 +44,9 @@ public class MinTimeFirehose implements Firehose
@Override
public InputRow nextRow()
{
if (savedInputRow != null) {
final InputRow row = savedInputRow;
savedInputRow = null;
return row;
} else {
while (firehose.hasMore()) {
final InputRow row = firehose.nextRow();
if (acceptable(row)) {
return row;
}
}
throw new NoSuchElementException("No more rows!");
}
final InputRow row = savedInputRow;
savedInputRow = null;
return row;
}
@Override