addH is a version of the add method specialized for hSample.
(s hSample)
| 544 | |
| 545 | // addH is a version of the add method specialized for hSample. |
| 546 | func (r *sampleRing) addH(s hSample) { |
| 547 | switch r.bufInUse { |
| 548 | case hBuf: // Add to existing hSamples. |
| 549 | r.hBuf = addH(s, r.hBuf, r) |
| 550 | case noBuf: // Add first sample. |
| 551 | r.hBuf = addH(s, r.hBuf, r) |
| 552 | r.bufInUse = hBuf |
| 553 | case iBuf: // Already have interface samples. Add to the interface buf. |
| 554 | r.iBuf = addSample(s, r.iBuf, r) |
| 555 | default: |
| 556 | // Already have specialized samples that are not hSamples. |
| 557 | // Need to call the checked add method for conversion. |
| 558 | r.add(s) |
| 559 | } |
| 560 | } |
| 561 | |
| 562 | // addFH is a version of the add method specialized for fhSample. |
| 563 | func (r *sampleRing) addFH(s fhSample) { |