According to tests it is equal performance wise, so why not make a code shorter.
This commit is contained in:
parent
7d447be786
commit
c4532fea24
@ -110,9 +110,7 @@ func lastPlayedSongs(lastNSongs int, playlistPath string) ([]Song, error) {
|
|||||||
return songs, nil
|
return songs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
lines := strings.Split(string(out), "\n")
|
for _, song := range strings.Split(string(out), "\n") {
|
||||||
|
|
||||||
for _, song := range lines {
|
|
||||||
ts := strings.Split(song, "|")
|
ts := strings.Split(song, "|")
|
||||||
if len(ts) <= 1 {
|
if len(ts) <= 1 {
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user