1
0

In CheckAndUpdateMostListenedSong() accept Song by value instead of a pointer.

This commit is contained in:
Alexander Andreev 2023-10-05 18:19:41 +04:00
parent c7f6b3072d
commit 9b14d7846b
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -46,8 +46,8 @@ var mostListened MostListenedSong
//
// So it would be fairer to give these listeners back to a song they was
// listening to.
func CheckAndUpdateMostListenedSong(cur *Song) {
if cur == nil || cur.Artist == "" {
func CheckAndUpdateMostListenedSong(cur Song) {
if cur.Artist == "" {
return
}
if cur.MaxListeners > mostListened.Listeners {