From 3c617e9632de10de8ac668e38bf89daab634e447 Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Fri, 25 Aug 2017 18:20:47 +1100 Subject: [PATCH] Fixup 7c90666bcc1e --- src/gui/widgets/listbox.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index 6435a23d4869..95ea37498097 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -636,16 +636,12 @@ void listbox::set_active_sorting_option(const order_pair& sort_by, const bool se const listbox::order_pair listbox::get_active_sorting_option() { - unsigned int column = 0; - - for(const auto& order : orders_) { - selectable_item* w = order.first; + for(unsigned int column = 0; column < orders_.size(); ++column) { + selectable_item* w = orders_[column].first; if(w && w->get_value() != SORT_NONE) { return std::make_pair(column, static_cast(w->get_value())); } - - ++column; } return std::make_pair(-1, SORT_NONE);