(frame *frameDec)
| 940 | } |
| 941 | |
| 942 | func (d *Decoder) setDict(frame *frameDec) (err error) { |
| 943 | dict, ok := d.o.dicts[frame.DictionaryID] |
| 944 | if ok { |
| 945 | if debugDecoder { |
| 946 | println("setting dict", frame.DictionaryID) |
| 947 | } |
| 948 | frame.history.setDict(dict) |
| 949 | } else if frame.DictionaryID != 0 { |
| 950 | // A zero or missing dictionary id is ambiguous: |
| 951 | // either dictionary zero, or no dictionary. In particular, |
| 952 | // zstd --patch-from uses this id for the source file, |
| 953 | // so only return an error if the dictionary id is not zero. |
| 954 | err = ErrUnknownDictionary |
| 955 | } |
| 956 | return err |
| 957 | } |
no test coverage detected