Ticket #3547: mc-3547-listbox.c-remove-redundant-code.patch

File mc-3547-listbox.c-remove-redundant-code.patch, 875 bytes (added by mooffie, 7 years ago)
  • lib/widget/listbox.c

    From 2e2e7b13631547091b54bddae5d523823a71e43c Mon Sep 17 00:00:00 2001
    From: Mooffie <mooffie@gmail.com>
    Date: Sat, 21 Nov 2015 23:44:58 +0200
    Subject: [PATCH] listbox.c: remove redundant code.
    
    This l->top calculation is already done in listbox_select_entry().
    ---
     lib/widget/listbox.c | 6 ------
     1 file changed, 6 deletions(-)
    
    diff --git a/lib/widget/listbox.c b/lib/widget/listbox.c
    index ab3fc1f..4861ce1 100644
    a b listbox_key (WListbox * l, int key) 
    330330    /* focus on listbox item N by '0'..'9' keys */ 
    331331    if (key >= '0' && key <= '9') 
    332332    { 
    333         int oldpos = l->pos; 
    334333        listbox_select_entry (l, key - '0'); 
    335  
    336         /* need scroll to item? */ 
    337         if (abs (oldpos - l->pos) > WIDGET (l)->lines) 
    338             l->top = l->pos; 
    339  
    340334        return MSG_HANDLED; 
    341335    } 
    342336