PackageFileHeapWriter: Fix update case

* Pull _UnwriteLastPartialChunk() out of Reinit() for reuse.
* _UnwriteLastPartialChunk(): fPendingDataSize wasn't set.
* _PushChunks(): Some simplifications for clarity.
* ChunkBuffer/RemoveDataRanges(): Use data reading and decompression
  methods provided by our base class instead of duplicating the
  implementation.
* RemoveDataRanges():
  - _FlushPendingData() before starting, so we don't ignore the pending
    data and _UnwriteLastPartialChunk() when done, so a partial chunk
    is read back into the pending data buffer.
  - fUncompressedHeapSize wasn't reset before the main processing loop,
    thus resulting in an erroneous size later on.
This commit is contained in:
Ingo Weinhold
2013-05-25 01:12:27 +02:00
parent 520a7a76c7
commit b05413ed78
2 changed files with 68 additions and 69 deletions
@@ -68,6 +68,8 @@ private:
struct ChunkSegment;
struct ChunkBuffer;
friend struct ChunkBuffer;
private:
void _Uninit();
@@ -81,6 +83,7 @@ private:
void _PushChunks(ChunkBuffer& chunkBuffer,
uint64 startOffset, uint64 endOffset);
void _UnwriteLastPartialChunk();
private:
void* fPendingDataBuffer;