Skip to content

Commit

Permalink
call ReadFrom directly instead of CopyN (grafana#1335)
Browse files Browse the repository at this point in the history
  • Loading branch information
dleviminzi authored Aug 2, 2022
1 parent 61384d9 commit b130a3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/structs/transporttrie/serialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func IterateRaw(r io.Reader, buf []byte, cb func(k []byte, v int)) error {
return err
}
if nameLen != 0 {
copied, err = io.CopyN(b, br, int64(nameLen))
copied, err = b.ReadFrom(io.LimitReader(br, int64(nameLen)))
if err != nil {
return err
}
Expand Down

0 comments on commit b130a3e

Please sign in to comment.