From a690936ed75e96627be0e2ecafee2360a71e8d3c Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Sun, 23 Sep 2018 12:23:54 +0100 Subject: Codechange: Replace SmallVector::Length() with std::vector::size() --- src/widgets/dropdown.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index f789b47b7..6acbd79c2 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -151,7 +151,7 @@ struct DropdownWindow : Window { DropdownWindow(Window *parent, const DropDownList *list, int selected, int button, bool instant_close, const Point &position, const Dimension &size, Colours wi_colour, bool scroll) : Window(&_dropdown_desc) { - assert(list->Length() > 0); + assert(list->size() > 0); this->position = position; @@ -180,8 +180,8 @@ struct DropdownWindow : Window { } /* Capacity is the average number of items visible */ - this->vscroll->SetCapacity(size.height * (uint16)list->Length() / list_height); - this->vscroll->SetCount((uint16)list->Length()); + this->vscroll->SetCapacity(size.height * (uint16)list->size() / list_height); + this->vscroll->SetCount((uint16)list->size()); this->parent_wnd_class = parent->window_class; this->parent_wnd_num = parent->window_number; @@ -418,7 +418,7 @@ void ShowDropDownListAt(Window *w, const DropDownList *list, int selected, int b /* If the dropdown doesn't fully fit, we need a dropdown. */ if (height > available_height) { scroll = true; - uint avg_height = height / list->Length(); + uint avg_height = height / list->size(); /* Check at least there is space for one item. */ assert(available_height >= avg_height); @@ -514,7 +514,7 @@ void ShowDropDownMenu(Window *w, const StringID *strings, int selected, int butt } /* No entries in the list? */ - if (list->Length() == 0) { + if (list->size() == 0) { delete list; return; } -- cgit v1.2.3-54-g00ecf