Skip to content

Commit

Permalink
update initial compressed buffer size calc
Browse files Browse the repository at this point in the history
  • Loading branch information
glookka committed Mar 7, 2023
1 parent a23da14 commit 1310c8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ bool IntCodec_c::Decode ( const util::Span_T<uint32_t> & dCompressed, util::Span
template <typename T>
void IntCodec_c::Encode ( const util::Span_T<T> & dUncompressed, std::vector<uint32_t> & dCompressed, FastPForLib::IntegerCODEC & tCodec )
{
const size_t EXTRA_GAP = 4096;
dCompressed.resize ( dUncompressed.size() + EXTRA_GAP );
const size_t EXTRA_GAP = 1024;
dCompressed.resize ( dUncompressed.size()*sizeof(dUncompressed[0])/sizeof(dCompressed[0]) + EXTRA_GAP );
size_t uCompressedSize = dCompressed.size();
tCodec.encodeArray ( dUncompressed.data(), dUncompressed.size(), dCompressed.data(), uCompressedSize );
dCompressed.resize(uCompressedSize);
Expand Down

0 comments on commit 1310c8a

Please sign in to comment.