MCPcopy
hub / github.com/klauspost/compress / updateHistory

Method updateHistory

zstd/blockdec.go:690–712  ·  view source on GitHub ↗
(hist *history)

Source from the content-addressed store, hash-verified

688}
689
690func (b *blockDec) updateHistory(hist *history) error {
691 if len(b.data) > maxCompressedBlockSize {
692 return fmt.Errorf("compressed block size too large (%d)", len(b.data))
693 }
694 // Set output and release references.
695 b.dst = hist.decoders.out
696 hist.recentOffsets = hist.decoders.prevOffset
697
698 if b.Last {
699 // if last block we don't care about history.
700 println("Last block, no history returned")
701 hist.b = hist.b[:0]
702 return nil
703 } else {
704 hist.append(b.dst)
705 if debugDecoder {
706 println("Finished block with ", len(b.sequence), "sequences. Added", len(b.dst), "to history, now length", len(hist.b))
707 }
708 }
709 hist.decoders.out, hist.decoders.literals = nil, nil
710
711 return nil
712}

Callers 1

executeSequencesMethod · 0.95

Calls 2

printlnFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected