From b2e017d7b13c17b734bab48b84eb4ed1154c1a7c Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Mon, 26 Jan 2009 08:27:10 +0100 Subject: [PATCH] Remove redundant check --- src/godmode.c | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/src/godmode.c b/src/godmode.c index fe05b718..9f0368ad 100644 --- a/src/godmode.c +++ b/src/godmode.c @@ -212,43 +212,31 @@ static int interface_part_bad_ncurses(disk_t *disk_car, list_part_t *list_part) quit=1; break; case KEY_UP: - if(list_part!=NULL) + if(pos->prev!=NULL) { - if(pos->prev!=NULL) - { - pos=pos->prev; - pos_num--; - } + pos=pos->prev; + pos_num--; } break; case KEY_DOWN: - if(list_part!=NULL) + if(pos->next!=NULL) { - if(pos->next!=NULL) - { - pos=pos->next; - pos_num++; - } + pos=pos->next; + pos_num++; } break; case KEY_PPAGE: - if(list_part!=NULL) + for(i=0; iprev!=NULL; i++) { - for(i=0; iprev!=NULL; i++) - { - pos=pos->prev; - pos_num--; - } + pos=pos->prev; + pos_num--; } break; case KEY_NPAGE: - if(list_part!=NULL) + for(i=0; inext!=NULL; i++) { - for(i=0; inext!=NULL; i++) - { - pos=pos->next; - pos_num++; - } + pos=pos->next; + pos_num++; } break; default: