mirror of
https://github.com/Belphemur/CBZOptimizer.git
synced 2025-10-14 12:38:50 +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 {
|
||||
if !f.FileInfo().IsDir() {
|
||||
if f.FileInfo().IsDir() {
|
||||
continue
|
||||
}
|
||||
// Open the file inside the zip
|
||||
rc, err := f.Open()
|
||||
if err != nil {
|
||||
@@ -81,7 +83,7 @@ func LoadChapter(filePath string) (*packer.Chapter, error) {
|
||||
chapter.Pages = append(chapter.Pages, page)
|
||||
}
|
||||
rc.Close()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return chapter, nil
|
||||
|
Reference in New Issue
Block a user