2nd fix: The same problem had size()

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1374646 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2012-08-18 19:53:50 +00:00
parent 39435cdc23
commit 54a623db68
1 changed files with 4 additions and 7 deletions

View File

@ -64,11 +64,7 @@ public final class FieldFilterAtomicReader extends FilterAtomicReader {
f = new FieldFilterFields(f);
// we need to check for emptyness, so we can return
// null:
if (f.iterator().hasNext()) {
return f;
} else {
return null;
}
return f.iterator().hasNext() ? f : null;
}
@Override
@ -146,7 +142,8 @@ public final class FieldFilterAtomicReader extends FilterAtomicReader {
// TODO: add faster implementation!
int c = 0;
final Iterator<String> it = iterator();
while (it.next() != null) {
while (it.hasNext()) {
it.next();
c++;
}
return c;
@ -156,7 +153,7 @@ public final class FieldFilterAtomicReader extends FilterAtomicReader {
public Iterator<String> iterator() {
final Iterator<String> in = super.iterator();
return new Iterator<String>() {
String cached = null;
private String cached = null;
@Override
public String next() {