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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user