Skip to content

Commit

Permalink
perf: Alloc records in batch (#2646)
Browse files Browse the repository at this point in the history
Signed-off-by: Ronan Harmegnies <[email protected]>
  • Loading branch information
ronanh authored Sep 7, 2023
1 parent 05cb9fa commit 4b55bb3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions record_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ func (e recordsArray) encode(pe packetEncoder) error {
}

func (e recordsArray) decode(pd packetDecoder) error {
records := make([]Record, len(e))
for i := range e {
rec := &Record{}
if err := rec.decode(pd); err != nil {
if err := records[i].decode(pd); err != nil {
return err
}
e[i] = rec
e[i] = &records[i]
}
return nil
}
Expand Down

0 comments on commit 4b55bb3

Please sign in to comment.