Permalink
Browse files

fix offset calculation

  • Loading branch information...
1 parent 4549a98 commit de6260ddcbc5a532a1aa96f648bc44b55dedf6f2 @jbellis jbellis committed Nov 10, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/java/org/apache/cassandra/io/compress/CompressionMetadata.java
@@ -203,9 +203,9 @@ public int compare(Chunk o1, Chunk o2)
{
long offset = i * 8;
long chunkOffset = chunkOffsets.getLong(offset);
- long nextChunkOffset = (i + 8 == chunkOffsets.size())
- ? compressedFileLength
- : chunkOffsets.getLong(offset + 8);
+ long nextChunkOffset = offset + 8 == chunkOffsets.size()
+ ? compressedFileLength
+ : chunkOffsets.getLong(offset + 8);
offsets.add(new Chunk(chunkOffset, (int) (nextChunkOffset - chunkOffset - 4))); // "4" bytes reserved for checksum
}
}

0 comments on commit de6260d

Please sign in to comment.