1
0
mirror of https://github.com/fumiama/dupimage.git synced 2026-06-05 02:00:32 +08:00

优化并发

This commit is contained in:
源文雨
2022-07-26 15:22:37 +08:00
parent 4fb796cea5
commit 0ec4522bee

View File

@@ -90,15 +90,14 @@ func main() {
continue
}
im, _, err := image.Decode(f)
_ = f.Close()
if err != nil {
fmt.Println("ERROR:", err)
_ = f.Close()
continue
}
dh, err := goimagehash.DifferenceHash(im)
if err != nil {
fmt.Println("ERROR:", err)
_ = f.Close()
continue
}
mu.Lock()
@@ -108,7 +107,6 @@ func main() {
})
fmt.Print("read: ", len(chklst), " / ", len(imgs), "\r")
mu.Unlock()
_ = f.Close()
}
}
wg.Done()