You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2012/08/13 12:54:21 UTC
svn commit: r1372357 -
/lucene/dev/branches/pforcodec_3892/lucene/core/src/java/org/apache/lucene/codecs/block/ForUtil.java
Author: mikemccand
Date: Mon Aug 13 10:54:21 2012
New Revision: 1372357
URL: http://svn.apache.org/viewvc?rev=1372357&view=rev
Log:
LUCENE-3892: use vInt to store the fixed value for entire block
Modified:
lucene/dev/branches/pforcodec_3892/lucene/core/src/java/org/apache/lucene/codecs/block/ForUtil.java
Modified: lucene/dev/branches/pforcodec_3892/lucene/core/src/java/org/apache/lucene/codecs/block/ForUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/pforcodec_3892/lucene/core/src/java/org/apache/lucene/codecs/block/ForUtil.java?rev=1372357&r1=1372356&r2=1372357&view=diff
==============================================================================
--- lucene/dev/branches/pforcodec_3892/lucene/core/src/java/org/apache/lucene/codecs/block/ForUtil.java (original)
+++ lucene/dev/branches/pforcodec_3892/lucene/core/src/java/org/apache/lucene/codecs/block/ForUtil.java Mon Aug 13 10:54:21 2012
@@ -151,7 +151,7 @@ final class ForUtil {
void writeBlock(int[] data, byte[] encoded, IndexOutput out) throws IOException {
if (isAllEqual(data)) {
out.writeVInt(ALL_VALUES_EQUAL);
- out.writeInt(data[0]);
+ out.writeVInt(data[0]);
return;
}
@@ -182,7 +182,7 @@ final class ForUtil {
assert numBits <= 32 : numBits;
if (numBits == ALL_VALUES_EQUAL) {
- final int value = in.readInt();
+ final int value = in.readVInt();
Arrays.fill(decoded, 0, BLOCK_SIZE, value);
return;
}
@@ -206,7 +206,7 @@ final class ForUtil {
void skipBlock(IndexInput in) throws IOException {
final int numBits = in.readVInt();
if (numBits == ALL_VALUES_EQUAL) {
- in.seek(in.getFilePointer() + 4);
+ in.readVInt();
return;
}
assert numBits > 0 && numBits <= 32 : numBits;