MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / AddFilter

Method AddFilter

Libraries/unrar/unpack50.cpp:197–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195
196
197bool Unpack::AddFilter(UnpackFilter &Filter)
198{
199 if (Filters.Size()>=MAX_UNPACK_FILTERS)
200 {
201 UnpWriteBuf(); // Write data, apply and flush filters.
202 if (Filters.Size()>=MAX_UNPACK_FILTERS)
203 InitFilters(); // Still too many filters, prevent excessive memory use.
204 }
205
206 // If distance to filter start is that large that due to circular dictionary
207 // mode now it points to old not written yet data, then we set 'NextWindow'
208 // flag and process this filter only after processing that older data.
209 Filter.NextWindow=WrPtr!=UnpPtr && ((WrPtr-UnpPtr)&MaxWinMask)<=Filter.BlockStart;
210
211 Filter.BlockStart=uint((Filter.BlockStart+UnpPtr)&MaxWinMask);
212 Filters.Push(Filter);
213 return true;
214}
215
216
217bool Unpack::UnpReadBuf()

Callers

nothing calls this directly

Calls 2

PushMethod · 0.80
SizeMethod · 0.45

Tested by

no test coverage detected