lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject cvs commit: jakarta-lucene/src/java/org/apache/lucene/search FieldSortedHitQueue.java
Date Wed, 29 Sep 2004 21:17:03 GMT
cutting     2004/09/29 14:17:02

  Modified:    src/java/org/apache/lucene/search Tag: lucene_1_4_2_dev
                        FieldSortedHitQueue.java
  Log:
  Applied patch for sort-related memory leaks to 1.4.2 branch.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.11.2.1  +5 -7      jakarta-lucene/src/java/org/apache/lucene/search/FieldSortedHitQueue.java
  
  Index: FieldSortedHitQueue.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/FieldSortedHitQueue.java,v
  retrieving revision 1.11
  retrieving revision 1.11.2.1
  diff -u -r1.11 -r1.11.2.1
  --- FieldSortedHitQueue.java	21 Jul 2004 19:05:46 -0000	1.11
  +++ FieldSortedHitQueue.java	29 Sep 2004 21:17:00 -0000	1.11.2.1
  @@ -197,10 +197,9 @@
     static ScoreDocComparator comparatorInt (final IndexReader reader, final String fieldname)
     throws IOException {
       final String field = fieldname.intern();
  +    final int[] fieldOrder = FieldCache.DEFAULT.getInts (reader, field);
       return new ScoreDocComparator() {
   
  -      final int[] fieldOrder = FieldCache.DEFAULT.getInts (reader, field);
  -
         public final int compare (final ScoreDoc i, final ScoreDoc j) {
           final int fi = fieldOrder[i.doc];
           final int fj = fieldOrder[j.doc];
  @@ -229,10 +228,9 @@
     static ScoreDocComparator comparatorFloat (final IndexReader reader, final String fieldname)
     throws IOException {
       final String field = fieldname.intern();
  +    final float[] fieldOrder = FieldCache.DEFAULT.getFloats (reader, field);
       return new ScoreDocComparator () {
   
  -      protected final float[] fieldOrder = FieldCache.DEFAULT.getFloats (reader, field);
  -
         public final int compare (final ScoreDoc i, final ScoreDoc j) {
           final float fi = fieldOrder[i.doc];
           final float fj = fieldOrder[j.doc];
  @@ -261,8 +259,8 @@
     static ScoreDocComparator comparatorString (final IndexReader reader, final String fieldname)
     throws IOException {
       final String field = fieldname.intern();
  +    final FieldCache.StringIndex index = FieldCache.DEFAULT.getStringIndex (reader, field);
       return new ScoreDocComparator () {
  -      final FieldCache.StringIndex index = FieldCache.DEFAULT.getStringIndex (reader, field);
   
         public final int compare (final ScoreDoc i, final ScoreDoc j) {
           final int fi = index.order[i.doc];
  @@ -293,8 +291,8 @@
     throws IOException {
       final Collator collator = Collator.getInstance (locale);
       final String field = fieldname.intern();
  +    final String[] index = FieldCache.DEFAULT.getStrings (reader, field);
       return new ScoreDocComparator() {
  -      final String[] index = FieldCache.DEFAULT.getStrings (reader, field);
   
         public final int compare (final ScoreDoc i, final ScoreDoc j) {
           return collator.compare (index[i.doc], index[j.doc]);
  
  
  

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


Mime
View raw message