From e4d3cdca09959ee37c1e0f2a7a66880c6324449b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= Date: Sat, 13 May 2017 16:57:15 +0200 Subject: [PATCH] Simplify --- client/widgets/AdventureMapClasses.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/widgets/AdventureMapClasses.cpp b/client/widgets/AdventureMapClasses.cpp index 99c75da8c..1cea6ad3c 100644 --- a/client/widgets/AdventureMapClasses.cpp +++ b/client/widgets/AdventureMapClasses.cpp @@ -169,11 +169,10 @@ void CList::selectIndex(int which) void CList::selectNext() { - int index = getSelectedIndex(); - if (index < 0 || index+1 >= list->size()) - selectIndex(0); - else - selectIndex(index+1); + int index = getSelectedIndex() + 1; + if (index >= list->size()) + index = 0; + selectIndex(index); } void CList::selectPrev()