Put implements DecodingLayerContainer interface.
(d DecodingLayer)
| 75 | |
| 76 | // Put implements DecodingLayerContainer interface. |
| 77 | func (dl DecodingLayerSparse) Put(d DecodingLayer) DecodingLayerContainer { |
| 78 | maxLayerType := LayerType(len(dl) - 1) |
| 79 | for _, typ := range d.CanDecode().LayerTypes() { |
| 80 | if typ > maxLayerType { |
| 81 | maxLayerType = typ |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | if extra := maxLayerType - LayerType(len(dl)) + 1; extra > 0 { |
| 86 | dl = append(dl, make([]DecodingLayer, extra)...) |
| 87 | } |
| 88 | |
| 89 | for _, typ := range d.CanDecode().LayerTypes() { |
| 90 | dl[typ] = d |
| 91 | } |
| 92 | return dl |
| 93 | } |
| 94 | |
| 95 | // LayersDecoder implements DecodingLayerContainer interface. |
| 96 | func (dl DecodingLayerSparse) LayersDecoder(first LayerType, df DecodeFeedback) DecodingLayerFunc { |
nothing calls this directly
no test coverage detected