mirror of https://github.com/apache/lucene.git
- Small efficiency improvement.
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@149939 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
31ec31b325
commit
b13e0488cb
|
@ -153,14 +153,11 @@ public final class Document implements java.io.Serializable {
|
|||
}
|
||||
}
|
||||
int fieldCount = tempFieldList.size();
|
||||
if (fieldCount == 0)
|
||||
if (fieldCount == 0) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
Field[] fields = new Field[fieldCount];
|
||||
for (int i = 0; i < fieldCount; i++) {
|
||||
fields[i] = (Field) tempFieldList.get(i);
|
||||
}
|
||||
return fields;
|
||||
return (Field[])tempFieldList.toArray(new Field[] {});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue