Logical error fix and cleanup for zathura_jumplist_reset_current

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
Marwan Tanager 2013-06-30 18:06:48 +02:00 committed by Sebastian Ramacher
parent 3cf8fba779
commit 486698d9fb

View file

@ -1220,18 +1220,14 @@ zathura_jumplist_backward(zathura_t* zathura)
static void static void
zathura_jumplist_reset_current(zathura_t* zathura) zathura_jumplist_reset_current(zathura_t* zathura)
{ {
g_return_if_fail(zathura != NULL || zathura->jumplist.cur != NULL); g_return_if_fail(zathura != NULL && zathura->jumplist.cur != NULL);
if (girara_list_iterator_has_next(zathura->jumplist.cur) == false) {
return;
}
while (true) { while (true) {
girara_list_iterator_next(zathura->jumplist.cur);
if (girara_list_iterator_has_next(zathura->jumplist.cur) == false) { if (girara_list_iterator_has_next(zathura->jumplist.cur) == false) {
return; return;
} }
girara_list_iterator_next(zathura->jumplist.cur);
} }
} }