From c4532fea2460d291fba1d237e7038b045965d69a Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Fri, 1 Apr 2022 23:20:04 +0400 Subject: [PATCH] According to tests it is equal performance wise, so why not make a code shorter. --- internal/radio/icecast.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/radio/icecast.go b/internal/radio/icecast.go index 26ef7a7..c8f92d6 100644 --- a/internal/radio/icecast.go +++ b/internal/radio/icecast.go @@ -110,9 +110,7 @@ func lastPlayedSongs(lastNSongs int, playlistPath string) ([]Song, error) { return songs, nil } - lines := strings.Split(string(out), "\n") - - for _, song := range lines { + for _, song := range strings.Split(string(out), "\n") { ts := strings.Split(song, "|") if len(ts) <= 1 { continue