Skip to content

Commit

Permalink
perf(movie): Preallocate buffer when loading movie
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Sep 3, 2024
1 parent 42e2286 commit 412660a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/movie/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func (m *Movie) LoadFile(path string, src io.Reader, speed float64) error {
m.Height = frameHeight
}
buf.Reset()
buf.Grow(m.Width * m.Height)
m.Frames = append(m.Frames, f)
}
if !ok {
Expand Down

0 comments on commit 412660a

Please # to comment.