Skip to content

Commit

Permalink
switch to 1MB buffer and fix panic mentioned in #65
Browse files Browse the repository at this point in the history
  • Loading branch information
sselph committed Feb 3, 2016
1 parent 5d34d1b commit 9498e60
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ds/hasher.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func NewHasher(hashFunc func() hash.Hash, threads int) (*Hasher, error) {
l := make(map[string]*sync.Mutex)
b := make(chan []byte, threads)
for i := 0; i < threads; i++ {
b <- make([]byte, 4*1024*1024)
b <- make([]byte, 1*1024*1024)
}
return &Hasher{h: hashFunc, c: c, cl: &sync.Mutex{}, l: l, b: b}, nil
}
2 changes: 1 addition & 1 deletion rom/rom.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ Loop:
game.Overview = strings.Map(stripChars, game.Overview)
game.GameTitle = strings.Map(stripChars, game.GameTitle)
}
if opts.OverviewLen != 0 && opts.OverviewLen > 0 && len(game.Overview) > opts.OverviewLen + 3 {
if opts.OverviewLen != 0 && opts.OverviewLen > 0 && len(game.Overview) > opts.OverviewLen+3 {
game.Overview = game.Overview[:opts.OverviewLen] + "..."
}
r.Game = game
Expand Down
2 changes: 1 addition & 1 deletion scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,11 +522,11 @@ func main() {
}
if *mame || *scrapeAll {
mds, err := ds.NewMAME("")
defer mds.Close()
if err != nil {
fmt.Println(err)
return
}
defer mds.Close()
arcadeSources = append(arcadeSources, mds)
}
var hasher *ds.Hasher
Expand Down

0 comments on commit 9498e60

Please sign in to comment.