summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2018-09-25 21:20:24 +0100
committerPeterN <peter@fuzzle.org>2019-03-26 20:15:57 +0000
commit097328c3d73520834b4ef801945c4f57f9eca0cd (patch)
treeb128c52ecba8fecc8bec436b5517faf0f976d5d2 /src/network
parentaa7ca7fe64af51c2cd2400e3dec477dfbddadae3 (diff)
downloadopenttd-097328c3d73520834b4ef801945c4f57f9eca0cd.tar.xz
Codechange: Replaced SmallVector::Get() const with std alternatives
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network_content.h2
-rw-r--r--src/network/network_content_gui.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/network/network_content.h b/src/network/network_content.h
index a81cc6a6d..7cce7fc0a 100644
--- a/src/network/network_content.h
+++ b/src/network/network_content.h
@@ -133,7 +133,7 @@ public:
/** Get the begin of the content inf iterator. */
ConstContentIterator Begin() const { return this->infos.Begin(); }
/** Get the nth position of the content inf iterator. */
- ConstContentIterator Get(uint32 index) const { return this->infos.Get(index); }
+ ConstContentIterator Get(uint32 index) const { return this->infos.data() + index; }
/** Get the end of the content inf iterator. */
ConstContentIterator End() const { return this->infos.End(); }
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index 51215935c..109e63c95 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -641,7 +641,7 @@ public:
int text_y_offset = WD_MATRIX_TOP + (line_height - FONT_HEIGHT_NORMAL) / 2;
uint y = r.top;
int cnt = 0;
- for (ConstContentIterator iter = this->content.Get(this->vscroll->GetPosition()); iter != this->content.End() && cnt < this->vscroll->GetCapacity(); iter++, cnt++) {
+ for (ConstContentIterator iter = this->content.data() + this->vscroll->GetPosition(); iter != this->content.End() && cnt < this->vscroll->GetCapacity(); iter++, cnt++) {
const ContentInfo *ci = *iter;
if (ci == this->selected) GfxFillRect(r.left + 1, y + 1, r.right - 1, y + this->resize.step_height - 1, PC_GREY);
@@ -793,7 +793,7 @@ public:
uint id_v = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_NCL_MATRIX);
if (id_v >= this->content.size()) return; // click out of bounds
- this->selected = *this->content.Get(id_v);
+ this->selected = this->content[id_v];
this->list_pos = id_v;
const NWidgetBase *checkbox = this->GetWidget<NWidgetBase>(WID_NCL_CHECKBOX);
@@ -923,7 +923,7 @@ public:
return ES_HANDLED;
}
- this->selected = *this->content.Get(this->list_pos);
+ this->selected = this->content[this->list_pos];
if (this->UpdateFilterState()) {
this->content.ForceRebuild();