Code

screen_queue: eliminated length check in center()
authorMax Kellermann <max@duempel.org>
Mon, 2 Nov 2009 17:23:53 +0000 (18:23 +0100)
committerMax Kellermann <max@duempel.org>
Mon, 2 Nov 2009 17:23:53 +0000 (18:23 +0100)
list_window_center() does all the checks fine.  Don't duplicate that.

src/screen_queue.c

index 93b3cfe5498089967fee682ae998e5d3d6b675a7..4eb3c734e8614c58085edf9c0176d0436d340140 100644 (file)
@@ -136,7 +136,6 @@ screen_queue_lw_callback(unsigned idx, G_GNUC_UNUSED void *data)
 static void
 center_playing_item(struct mpdclient *c, bool center_cursor)
 {
-       unsigned length = c->playlist.list->len;
        int idx;
 
        /* try to center the song that are playing */
@@ -144,13 +143,6 @@ center_playing_item(struct mpdclient *c, bool center_cursor)
        if (idx < 0)
                return;
 
-       if (length < lw->rows)
-       {
-               if (center_cursor)
-                       list_window_set_cursor(lw, idx);
-               return;
-       }
-
        list_window_center(lw, idx);
 
        if (center_cursor) {