Commit 90feac95 authored by ale's avatar ale

Avoid reading input one sample at a time in radioprober

Small costly mistake.
parent 66c4c620
Pipeline #6080 passed with stages
in 5 minutes and 48 seconds
......@@ -48,12 +48,6 @@ type floatReader struct {
io.Reader
}
func (r floatReader) ReadFloats(buf []float64) (n int, err error) {
for n = 0; n < len(buf); n++ {
err = binary.Read(r.Reader, binary.LittleEndian, &buf[n])
if err != nil {
break
}
}
return
func (r floatReader) ReadFloats(buf []float64) error {
return binary.Read(r.Reader, binary.LittleEndian, buf)
}
......@@ -127,8 +127,7 @@ func (p *Prober) stream() {
fr := &floatReader{dec}
buf := make([]float64, bufSize)
for {
_, err := fr.ReadFloats(buf)
if err != nil {
if err := fr.ReadFloats(buf); err != nil {
break
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment