Reduce use of binary.Read and, by extention, reflection

This commit is contained in:
Caleb Gardner
2025-04-10 06:26:41 -05:00
parent 4490fc3873
commit 6b0e9ef2c6
8 changed files with 75 additions and 36 deletions
+1 -2
View File
@@ -1,7 +1,6 @@
package data
import (
"encoding/binary"
"io"
"io/fs"
@@ -56,7 +55,7 @@ func (r *Reader) advance() error {
return nil
}
r.dat = make([]byte, realSize)
err = binary.Read(r.r, binary.LittleEndian, &r.dat)
_, err = r.r.Read(r.dat)
if err != nil {
return err
}