summaryrefslogtreecommitdiff
path: root/src/autoreplace_gui.cpp
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2018-09-23 12:23:54 +0100
committerPeterN <peter@fuzzle.org>2019-03-26 20:15:57 +0000
commita690936ed75e96627be0e2ecafee2360a71e8d3c (patch)
tree1221c131b8fe3a51cf43a6bd7d89a51c431c559d /src/autoreplace_gui.cpp
parent56ae855dc20b27593c9a454d5a09d8f892a6c71f (diff)
downloadopenttd-a690936ed75e96627be0e2ecafee2360a71e8d3c.tar.xz
Codechange: Replace SmallVector::Length() with std::vector::size()
Diffstat (limited to 'src/autoreplace_gui.cpp')
-rw-r--r--src/autoreplace_gui.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp
index 356058e93..1286dc5a7 100644
--- a/src/autoreplace_gui.cpp
+++ b/src/autoreplace_gui.cpp
@@ -160,8 +160,8 @@ class ReplaceVehicleWindow : public Window {
if (this->engines[0].NeedRebuild()) {
/* We need to rebuild the left engines list */
this->GenerateReplaceVehList(true);
- this->vscroll[0]->SetCount(this->engines[0].Length());
- if (this->reset_sel_engine && this->sel_engine[0] == INVALID_ENGINE && this->engines[0].Length() != 0) {
+ this->vscroll[0]->SetCount(this->engines[0].size());
+ if (this->reset_sel_engine && this->sel_engine[0] == INVALID_ENGINE && this->engines[0].size() != 0) {
this->sel_engine[0] = this->engines[0][0];
}
}
@@ -180,7 +180,7 @@ class ReplaceVehicleWindow : public Window {
}
/* Regenerate the list on the right. Note: This resets sel_engine[1] to INVALID_ENGINE, if it is no longer available. */
this->GenerateReplaceVehList(false);
- this->vscroll[1]->SetCount(this->engines[1].Length());
+ this->vscroll[1]->SetCount(this->engines[1].size());
if (this->reset_sel_engine && this->sel_engine[1] != INVALID_ENGINE) {
int position = 0;
for (EngineID *it = this->engines[1].Begin(); it != this->engines[1].End(); ++it) {
@@ -384,7 +384,7 @@ public:
case WID_RV_RIGHT_MATRIX: {
int side = (widget == WID_RV_LEFT_MATRIX) ? 0 : 1;
EngineID start = this->vscroll[side]->GetPosition(); // what is the offset for the start (scrolling)
- EngineID end = min(this->vscroll[side]->GetCapacity() + start, this->engines[side].Length());
+ EngineID end = min(this->vscroll[side]->GetCapacity() + start, this->engines[side].size());
/* Do the actual drawing */
DrawEngineList((VehicleType)this->window_number, r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP,
@@ -508,7 +508,7 @@ public:
click_side = 1;
}
uint i = this->vscroll[click_side]->GetScrolledRowFromWidget(pt.y, this, widget);
- size_t engine_count = this->engines[click_side].Length();
+ size_t engine_count = this->engines[click_side].size();
EngineID e = engine_count > i ? this->engines[click_side][i] : INVALID_ENGINE;
if (e == this->sel_engine[click_side]) break; // we clicked the one we already selected