You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by mi...@apache.org on 2010/01/16 19:41:51 UTC

svn commit: r900010 - /lucene/java/trunk/src/java/org/apache/lucene/util/SortedVIntList.java

Author: mikemccand
Date: Sat Jan 16 18:41:51 2010
New Revision: 900010

URL: http://svn.apache.org/viewvc?rev=900010&view=rev
Log:
LUCENE-2217: use ArrayUtil.getNextSize when growing

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/util/SortedVIntList.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/util/SortedVIntList.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/util/SortedVIntList.java?rev=900010&r1=900009&r2=900010&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/util/SortedVIntList.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/util/SortedVIntList.java Sat Jan 16 18:41:51 2010
@@ -128,8 +128,10 @@
       }
   
       if ((lastBytePos + MAX_BYTES_PER_INT) > bytes.length) {
-        // biggest possible int does not fit
-        resizeBytes((bytes.length * 2) + MAX_BYTES_PER_INT);
+        // Biggest possible int does not fit.
+        // Requires initial size of at least 9,
+        // see SortedVIntList.initBytes() and ArrayUtil.getNextSize()
+        ArrayUtil.getNextSize(bytes.length);
       }
   
       // See org.apache.lucene.store.IndexOutput.writeVInt()