From b42c87c9f8dcae7cf17c3c05c8c7baa3dcdd6497 Mon Sep 17 00:00:00 2001 From: LordBex Date: Mon, 5 Sep 2022 21:59:00 +0200 Subject: [PATCH] remove stringInSlice and switch to ElementInSlice --- cli/commands/archive/archive.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/cli/commands/archive/archive.go b/cli/commands/archive/archive.go index 8ddc423..6a7cc8c 100644 --- a/cli/commands/archive/archive.go +++ b/cli/commands/archive/archive.go @@ -530,21 +530,12 @@ func archiveDownloadVideos(downloader crunchyroll.Downloader, filename string, v return files, nil } -func stringInSlice(a string, list []string) bool { - for _, b := range list { - if b == a { - return true - } - } - return false -} - func archiveDownloadSubtitles(filename string, subtitles ...*crunchyroll.Subtitle) ([]string, error) { var files []string for _, subtitle := range subtitles { if len(archiveSubLanguagesFlag) > 0 { - if !stringInSlice(string(subtitle.Locale), archiveSubLanguagesFlag) { + if !utils.ElementInSlice(string(subtitle.Locale), archiveSubLanguagesFlag) { continue } }