Skip to content

Commit

Permalink
Fix handling of starting offset for compression
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Feb 13, 2024
1 parent 1eb9973 commit 4c06bc0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/compression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ argtokey_callback_t Compression::compress(MDB_val* value, void (*freeValue)(MDB_
if (!stream)
stream = LZ4_createStream();
LZ4_loadDict(stream, compressDictionary, dictionarySize);
// TODO: Add in offset here
int compressedSize = LZ4_compress_fast_continue(stream, data, compressed + prefixSize, dataLength, maxCompressedSize, acceleration);
int compressedSize = LZ4_compress_fast_continue(stream, data + startingOffset, compressed + prefixSize, dataLength, maxCompressedSize, acceleration);
if (compressedSize > 0) {
if (startingOffset > 0) // copy the uncompressed prefix
memcpy(compressed, data, startingOffset);
Expand Down

0 comments on commit 4c06bc0

Please sign in to comment.