lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r900010 - /lucene/java/trunk/src/java/org/apache/lucene/util/SortedVIntList.java
Date Sat, 16 Jan 2010 18:41:51 GMT
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()



Mime
View raw message