lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r1055638 - /lucene/dev/trunk/lucene/src/java/org/apache/lucene/util/ReaderUtil.java
Date Wed, 05 Jan 2011 21:04:28 GMT
Author: yonik
Date: Wed Jan  5 21:04:28 2011
New Revision: 1055638

URL: http://svn.apache.org/viewvc?rev=1055638&view=rev
Log:
LUCENE-2831: use int[] instead of AtomicInteger

Modified:
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/util/ReaderUtil.java

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/util/ReaderUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/util/ReaderUtil.java?rev=1055638&r1=1055637&r2=1055638&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/util/ReaderUtil.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/util/ReaderUtil.java Wed Jan  5 21:04:28
2011
@@ -19,7 +19,6 @@ package org.apache.lucene.util;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.atomic.AtomicInteger;
 import java.io.IOException;
 
 import org.apache.lucene.index.IndexReader;
@@ -197,19 +196,19 @@ public final class ReaderUtil {
     }
     
     private int numLeaves(IndexReader reader) {
-      final AtomicInteger numLeaves = new AtomicInteger();
+      final int[] numLeaves = new int[1];
       try {
         new Gather(reader) {
           @Override
           protected void add(int base, IndexReader r) {
-            numLeaves.incrementAndGet();
+            numLeaves[0]++;
           }
         }.run();
       } catch (IOException ioe) {
         // won't happen
         throw new RuntimeException(ioe);
       }
-      return numLeaves.get();
+      return numLeaves[0];
     }
     
   }



Mime
View raw message