Code

list_window: check for unchanged value in set_length()
authorMax Kellermann <max@duempel.org>
Wed, 30 Dec 2009 20:28:50 +0000 (21:28 +0100)
committerMax Kellermann <max@duempel.org>
Wed, 30 Dec 2009 20:28:55 +0000 (21:28 +0100)
Minor optimization.

src/list_window.c

index 822805c9b186b7f3d6345ec3499ad04a76a38840..4fe984dea796425c121e23ce3dc4e3df94aac3fd 100644 (file)
@@ -127,6 +127,9 @@ list_window_resize(struct list_window *lw, unsigned width, unsigned height)
 void
 list_window_set_length(struct list_window *lw, unsigned length)
 {
+       if (length == lw->length)
+               return;
+
        lw->length = length;
 
        list_window_check_selected(lw);