mirror of
https://github.com/Belphemur/CBZOptimizer.git
synced 2025-10-14 20:38:52 +02:00
perf: cleanup nested loop
This commit is contained in:
@@ -25,7 +25,9 @@ func LoadChapter(filePath string) (*packer.Chapter, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, f := range r.File {
|
for _, f := range r.File {
|
||||||
if !f.FileInfo().IsDir() {
|
if f.FileInfo().IsDir() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
// Open the file inside the zip
|
// Open the file inside the zip
|
||||||
rc, err := f.Open()
|
rc, err := f.Open()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -81,7 +83,7 @@ func LoadChapter(filePath string) (*packer.Chapter, error) {
|
|||||||
chapter.Pages = append(chapter.Pages, page)
|
chapter.Pages = append(chapter.Pages, page)
|
||||||
}
|
}
|
||||||
rc.Close()
|
rc.Close()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return chapter, nil
|
return chapter, nil
|
||||||
|
Reference in New Issue
Block a user