Remove redundant check

This commit is contained in:
Christophe Grenier 2009-01-26 08:27:10 +01:00
parent bb57e38772
commit b2e017d7b1

View file

@ -212,44 +212,32 @@ static int interface_part_bad_ncurses(disk_t *disk_car, list_part_t *list_part)
quit=1; quit=1;
break; break;
case KEY_UP: case KEY_UP:
if(list_part!=NULL)
{
if(pos->prev!=NULL) if(pos->prev!=NULL)
{ {
pos=pos->prev; pos=pos->prev;
pos_num--; pos_num--;
} }
}
break; break;
case KEY_DOWN: case KEY_DOWN:
if(list_part!=NULL)
{
if(pos->next!=NULL) if(pos->next!=NULL)
{ {
pos=pos->next; pos=pos->next;
pos_num++; pos_num++;
} }
}
break; break;
case KEY_PPAGE: case KEY_PPAGE:
if(list_part!=NULL)
{
for(i=0; i<INTER_BAD_PART && pos->prev!=NULL; i++) for(i=0; i<INTER_BAD_PART && pos->prev!=NULL; i++)
{ {
pos=pos->prev; pos=pos->prev;
pos_num--; pos_num--;
} }
}
break; break;
case KEY_NPAGE: case KEY_NPAGE:
if(list_part!=NULL)
{
for(i=0; i<INTER_BAD_PART && pos->next!=NULL; i++) for(i=0; i<INTER_BAD_PART && pos->next!=NULL; i++)
{ {
pos=pos->next; pos=pos->next;
pos_num++; pos_num++;
} }
}
break; break;
default: default:
break; break;