lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject cvs commit: jakarta-lucene/src/java/org/apache/lucene/document Document.java
Date Sun, 26 Jan 2003 03:34:28 GMT
otis        2003/01/25 19:34:28

  Modified:    src/java/org/apache/lucene/document Document.java
  Log:
  - Small efficiency improvement.
  
  Revision  Changes    Path
  1.8       +3 -6      jakarta-lucene/src/java/org/apache/lucene/document/Document.java
  
  Index: Document.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/document/Document.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Document.java	7 Jan 2003 16:09:03 -0000	1.7
  +++ Document.java	26 Jan 2003 03:34:28 -0000	1.8
  @@ -153,14 +153,11 @@
          }
        }
        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[] {});
        }
      }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message