Skip to content

Commit

Permalink
Properly use SortBy function
Browse files Browse the repository at this point in the history
The previous usage works, but only because the function as it is
currently implemented also sorts the passed list in place.
  • Loading branch information
leotaku committed Apr 19, 2023
1 parent a33b2ca commit b0303ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/business.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func getChapters(manga md.Manga) (md.ChapterList, error) {

// Ensure chapters from disk are preferred
if diskArg != "" {
chapters.SortBy(func(a md.ChapterInfo, b md.ChapterInfo) bool {
chapters = chapters.SortBy(func(a md.ChapterInfo, b md.ChapterInfo) bool {
return a.GroupNames.String() == "Filesystem" && b.GroupNames.String() != "Filesystem"
})
}
Expand Down

0 comments on commit b0303ab

Please sign in to comment.