mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
all: use bufio.Reader to improve reading speed
This commit is contained in:
parent
563f2e0e0b
commit
ef5ac4175d
@ -15,6 +15,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
_ "embed"
|
||||
"fmt"
|
||||
@ -81,7 +82,7 @@ func main() {
|
||||
fmt.Println("Play the default video. You can specify a video file as an argument.")
|
||||
}
|
||||
|
||||
player, err := newMPEGPlayer(in)
|
||||
player, err := newMPEGPlayer(bufio.NewReader(in))
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
@ -15,6 +15,7 @@
|
||||
package mtl_test
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"image"
|
||||
"image/color"
|
||||
@ -147,7 +148,7 @@ func readPNG(name string) (image.Image, error) {
|
||||
defer func() {
|
||||
_ = f.Close()
|
||||
}()
|
||||
return png.Decode(f)
|
||||
return png.Decode(bufio.NewReader(f))
|
||||
}
|
||||
|
||||
// imageEq reports whether images m, n are considered equivalent. Two images are considered
|
||||
|
Loading…
Reference in New Issue
Block a user