assigning to the wrong index
@@ -398,7 +398,7 @@ private void compress() throws IOException {
private int insertString(int pos) {
insertHash = nextHash(insertHash, window[pos - 1 + NUMBER_OF_BYTES_IN_HASH]);
int hashHead = head[insertHash];
- prev[currentPosition & wMask] = hashHead;
+ prev[pos & wMask] = hashHead;
head[insertHash] = pos;
return hashHead;
}
