From 275b1caa00f55e832936469d41eae305cd8490bb Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Mon, 21 Jan 2013 16:31:40 +0000 Subject: [PATCH] Directly pass acceptableOverheadRatio to PackedInts.getWriter. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4547@1436460 13f79535-47bb-0310-9956-ffa450edef68 --- .../lucene/codecs/lucene41/Lucene41DocValuesConsumer.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41DocValuesConsumer.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41DocValuesConsumer.java index e992e328b24..b206c7ba080 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41DocValuesConsumer.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene41/Lucene41DocValuesConsumer.java @@ -37,7 +37,6 @@ import org.apache.lucene.util.fst.FST.INPUT_TYPE; import org.apache.lucene.util.fst.PositiveIntOutputs; import org.apache.lucene.util.fst.Util; import org.apache.lucene.util.packed.PackedInts; -import org.apache.lucene.util.packed.PackedInts.FormatAndBits; /** * Writes numbers one of two ways: @@ -142,15 +141,14 @@ class Lucene41DocValuesConsumer extends DocValuesConsumer { } data.writeLong(minValue); - - FormatAndBits formatAndBits = PackedInts.fastestFormatAndBits(count, bitsPerValue, PackedInts.COMPACT); - final PackedInts.Writer writer = PackedInts.getWriter(data, count, formatAndBits.bitsPerValue, 0); + + final PackedInts.Writer writer = PackedInts.getWriter(data, count, bitsPerValue, PackedInts.COMPACT); for(Number nv : values) { writer.add(nv.longValue() - minValue); } writer.finish(); } - + @Override public void close() throws IOException { // nocommit: just write this to a RAMfile or something and flush it here, with #fields first.