- 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:
Otis Gospodnetic 2003-01-26 03:34:28 +00:00
parent 31ec31b325
commit b13e0488cb
1 changed files with 3 additions and 6 deletions

View File

@ -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[] {});
}
}