From bad2c2154b97613bd6a045cfe1f05cff876da1e4 Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Sun, 23 Sep 2018 16:43:00 +0100 Subject: Codechange: Replaced SmallVector::Resize() with std::vector::resize() --- src/core/smallstack_type.hpp | 2 +- src/core/smallvec_type.hpp | 9 --------- src/linkgraph/linkgraph.cpp | 2 +- src/linkgraph/linkgraphjob.cpp | 2 +- src/vehicle_gui.cpp | 2 +- 5 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/core/smallstack_type.hpp b/src/core/smallstack_type.hpp index 76d97f961..5a9d329a9 100644 --- a/src/core/smallstack_type.hpp +++ b/src/core/smallstack_type.hpp @@ -74,7 +74,7 @@ private: } if (index >= this->data.size() && index < Tmax_size) { - this->data.Resize(index + 1); + this->data.resize(index + 1); } return index; } diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 600b7ea26..e78f98a50 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -97,15 +97,6 @@ public: return this->End() - to_add; } - /** - * Set the size of the vector, effectively truncating items from the end or appending uninitialised ones. - * @param num_items Target size. - */ - inline void Resize(uint num_items) - { - std::vector::resize(num_items); - } - /** * Insert a new item at a specific position into the vector, moving all following items. * @param item Position at which the new item should be inserted diff --git a/src/linkgraph/linkgraph.cpp b/src/linkgraph/linkgraph.cpp index 34b3a4aa0..eee7ac61f 100644 --- a/src/linkgraph/linkgraph.cpp +++ b/src/linkgraph/linkgraph.cpp @@ -281,7 +281,7 @@ void LinkGraph::Init(uint size) { assert(this->Size() == 0); this->edges.Resize(size, size); - this->nodes.Resize(size); + this->nodes.resize(size); for (uint i = 0; i < size; ++i) { this->nodes[i].Init(); diff --git a/src/linkgraph/linkgraphjob.cpp b/src/linkgraph/linkgraphjob.cpp index 537303cf3..fcc9dce78 100644 --- a/src/linkgraph/linkgraphjob.cpp +++ b/src/linkgraph/linkgraphjob.cpp @@ -179,7 +179,7 @@ LinkGraphJob::~LinkGraphJob() void LinkGraphJob::Init() { uint size = this->Size(); - this->nodes.Resize(size); + this->nodes.resize(size); this->edges.Resize(size, size); for (uint i = 0; i < size; ++i) { this->nodes[i].Init(this->link_graph[i].Supply()); diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 36f08493e..95f0a28ec 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -482,7 +482,7 @@ struct RefitWindow : public Window { /* 0xFF item is in front, other subtypes are sorted. So just truncate the list in the right spot */ for (uint i = 1; i < l.size(); i++) { if (l[i].subtype >= refit_cyc) { - l.Resize(i); + l.resize(i); break; } } -- cgit v1.2.3-70-g09d2