changeset 35555:069de6f47ec1

Simplify code. Call listMgr(PLAYLIST_ITEM_GET_CURR, 0) only once.
author ib
date Mon, 10 Dec 2012 02:27:55 +0000
parents 5cccc59f4c5b
children 970ae81f8aee
files gui/interface.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Mon Dec 10 02:25:03 2012 +0000
+++ b/gui/interface.c	Mon Dec 10 02:27:55 2012 +0000
@@ -845,10 +845,12 @@
                 guiInfo.Angle = 1;
 
             if (isPlaylistStreamtype) {
-                if (!listMgr(PLAYLIST_ITEM_GET_CURR, 0))
+                plItem *curr = listMgr(PLAYLIST_ITEM_GET_CURR, 0);
+
+                if (!curr)
                     uiUnsetFile();
-                else if (listMgr(PLAYLIST_ITEM_GET_CURR, 0) != listMgr(PLAYLIST_GET, 0)) {
-                    plItem *curr = listMgr(PLAYLIST_ITEM_SET_CURR, listMgr(PLAYLIST_GET, 0));
+                else if (curr != listMgr(PLAYLIST_GET, 0)) {
+                    curr = listMgr(PLAYLIST_ITEM_SET_CURR, listMgr(PLAYLIST_GET, 0));
                     uiSetFile(curr->path, curr->name, STREAMTYPE_FILE);
                     guiInfo.Track = 1;
                 }