perf: use default for unlock the mutex

This commit is contained in:
Antoine Aflalo
2025-09-09 16:59:11 -04:00
parent 0a7cc506fd
commit 54de9bcdeb

View File

@@ -147,10 +147,10 @@ func (converter *Converter) ConvertChapter(ctx context.Context, chapter *manga.C
convertedPage.Page.Size = uint64(buffer.Len()) convertedPage.Page.Size = uint64(buffer.Len())
} }
pagesMutex.Lock() pagesMutex.Lock()
defer pagesMutex.Unlock()
pages = append(pages, convertedPage.Page) pages = append(pages, convertedPage.Page)
currentTotalPages := atomic.LoadUint32(&totalPages) currentTotalPages := atomic.LoadUint32(&totalPages)
progress(fmt.Sprintf("Converted %d/%d pages to %s format", len(pages), currentTotalPages, converter.Format()), uint32(len(pages)), currentTotalPages) progress(fmt.Sprintf("Converted %d/%d pages to %s format", len(pages), currentTotalPages, converter.Format()), uint32(len(pages)), currentTotalPages)
pagesMutex.Unlock()
}(page) }(page)
} }
}() }()