MCPcopy Create free account
hub / github.com/BlueAndi/Pixelix / copyCode

Method copyCode

lib/YAWidgets/src/LzwDecoder.cpp:267–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265 *****************************************************************************/
266
267bool LzwDecoder::copyCode(const LzwDecoder& other)
268{
269 bool isSuccessful = true;
270
271 if (nullptr != m_codes)
272 {
273 m_codeAllocator.deallocateArray(m_codes);
274 m_codes = nullptr;
275 }
276
277 if (nullptr != other.m_codes)
278 {
279 m_codes = m_codeAllocator.allocateArray(CODE_LIMIT);
280
281 if (nullptr == m_codes)
282 {
283 isSuccessful = false;
284 }
285 else
286 {
287 for (size_t idx = 0U; idx < CODE_LIMIT; ++idx)
288 {
289 m_codes[idx] = other.m_codes[idx];
290 }
291 }
292 }
293
294 return isSuccessful;
295}
296
297bool LzwDecoder::copyStack(const LzwDecoder& other)
298{

Callers

nothing calls this directly

Calls 2

deallocateArrayMethod · 0.80
allocateArrayMethod · 0.80

Tested by

no test coverage detected