You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2012/10/23 06:23:29 UTC
svn commit: r1401154 - in /lucene/dev/branches/branch_4x: ./ lucene/
lucene/core/
lucene/core/src/java/org/apache/lucene/codecs/lucene41/ForUtil.java
Author: rmuir
Date: Tue Oct 23 04:23:29 2012
New Revision: 1401154
URL: http://svn.apache.org/viewvc?rev=1401154&view=rev
Log:
fix a few incorrect datatypes in ForUtil
Modified:
lucene/dev/branches/branch_4x/ (props changed)
lucene/dev/branches/branch_4x/lucene/ (props changed)
lucene/dev/branches/branch_4x/lucene/core/ (props changed)
lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/lucene41/ForUtil.java
Modified: lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/lucene41/ForUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/lucene41/ForUtil.java?rev=1401154&r1=1401153&r2=1401154&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/lucene41/ForUtil.java (original)
+++ lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/lucene41/ForUtil.java Tue Oct 23 04:23:29 2012
@@ -157,7 +157,7 @@ final class ForUtil {
*/
void writeBlock(int[] data, byte[] encoded, IndexOutput out) throws IOException {
if (isAllEqual(data)) {
- out.writeVInt(ALL_VALUES_EQUAL);
+ out.writeByte((byte) ALL_VALUES_EQUAL);
out.writeVInt(data[0]);
return;
}
@@ -170,7 +170,7 @@ final class ForUtil {
final int encodedSize = encodedSizes[numBits];
assert (iters * encoder.blockCount()) << 3 >= encodedSize;
- out.writeVInt(numBits);
+ out.writeByte((byte) numBits);
encoder.encode(data, 0, encoded, 0, iters);
out.writeBytes(encoded, encodedSize);
@@ -185,7 +185,7 @@ final class ForUtil {
* @throws IOException If there is a low-level I/O error
*/
void readBlock(IndexInput in, byte[] encoded, int[] decoded) throws IOException {
- final int numBits = in.readVInt();
+ final int numBits = in.readByte();
assert numBits <= 32 : numBits;
if (numBits == ALL_VALUES_EQUAL) {
@@ -211,7 +211,7 @@ final class ForUtil {
* @throws IOException If there is a low-level I/O error
*/
void skipBlock(IndexInput in) throws IOException {
- final int numBits = in.readVInt();
+ final int numBits = in.readByte();
if (numBits == ALL_VALUES_EQUAL) {
in.readVInt();
return;
@@ -222,7 +222,7 @@ final class ForUtil {
}
private static boolean isAllEqual(final int[] data) {
- final long v = data[0];
+ final int v = data[0];
for (int i = 1; i < BLOCK_SIZE; ++i) {
if (data[i] != v) {
return false;