addFH is a version of the add method specialized for fhSample.
(s fhSample)
| 561 | |
| 562 | // addFH is a version of the add method specialized for fhSample. |
| 563 | func (r *sampleRing) addFH(s fhSample) { |
| 564 | switch r.bufInUse { |
| 565 | case fhBuf: // Add to existing fhSamples. |
| 566 | r.fhBuf = addFH(s, r.fhBuf, r) |
| 567 | case noBuf: // Add first sample. |
| 568 | r.fhBuf = addFH(s, r.fhBuf, r) |
| 569 | r.bufInUse = fhBuf |
| 570 | case iBuf: // Already have interface samples. Add to the interface buf. |
| 571 | r.iBuf = addSample(s, r.iBuf, r) |
| 572 | default: |
| 573 | // Already have specialized samples that are not fhSamples. |
| 574 | // Need to call the checked add method for conversion. |
| 575 | r.add(s) |
| 576 | } |
| 577 | } |
| 578 | |
| 579 | // addSample adds a sample to a buffer of chunks.Sample, i.e. the general case |
| 580 | // using an interface as the type. |