(hist *history)
| 688 | } |
| 689 | |
| 690 | func (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 | } |
no test coverage detected