mirror of
https://github.com/OpenTTD/OpenTTD
synced 2025-12-22 12:42:43 +01:00
Codechange: Use GetVisibleRangeIterators() in more places. (#12190)
This replaces more first/last index calculation, along with indexed array/vector access, with iterator access instead.
This commit is contained in:
@@ -441,8 +441,8 @@ public:
|
||||
GfxFillRect(br, PC_BLACK);
|
||||
|
||||
Rect tr = r.Shrink(WidgetDimensions::scaled.inset).WithHeight(this->resize.step_height);
|
||||
uint scroll_pos = this->vscroll->GetPosition();
|
||||
for (auto it = this->display_list.begin() + scroll_pos; it != this->display_list.end() && tr.top < br.bottom; ++it) {
|
||||
auto [first, last] = this->vscroll->GetVisibleRangeIterators(this->display_list);
|
||||
for (auto it = first; it != last; ++it) {
|
||||
const FiosItem *item = *it;
|
||||
|
||||
if (item == this->selected) {
|
||||
|
||||
Reference in New Issue
Block a user