diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index a4a6fccd17..85b2ddbb19 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -566,7 +566,7 @@ DEF_CONSOLE_CMD(ConUnBan) seprintf(msg, lastof(msg), "Unbanned %s", _network_ban_list[index]); IConsolePrint(CC_DEFAULT, msg); free(_network_ban_list[index]); - _network_ban_list.Erase(_network_ban_list.Get(index)); + _network_ban_list.erase(_network_ban_list.begin() + index); } else { IConsolePrint(CC_DEFAULT, "Invalid list index or IP not in ban-list."); IConsolePrint(CC_DEFAULT, "For a list of banned IP's, see the command 'banlist'"); diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 81b9cf7ee4..a682697b38 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -180,19 +180,6 @@ public: assert(index <= std::vector::size()); return this->Begin() + index; } - - /** - * Get the pointer to item "number" - * - * @param index the position of the item - * @return the pointer to the item - */ - inline T *Get(uint index) - { - /* Allow access to the 'first invalid' item */ - assert(index <= std::vector::size()); - return this->Begin() + index; - } }; diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index c2a258f180..caf264e3d1 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -344,6 +344,6 @@ void EngList_SortPartial(GUIEngineList *el, EngList_SortTypeFunction compare, ui if (num_items < 2) return; assert(begin < el->size()); assert(begin + num_items <= el->size()); - QSortT(el->Get(begin), num_items, compare); + QSortT(el->data() + begin, num_items, compare); } diff --git a/src/fios.h b/src/fios.h index 71a6cff175..0fe6fcc062 100644 --- a/src/fios.h +++ b/src/fios.h @@ -165,7 +165,7 @@ public: */ inline FiosItem *Get(uint index) { - return this->files.Get(index); + return this->files.data() + index; } inline const FiosItem &operator[](uint index) const diff --git a/src/linkgraph/linkgraph.cpp b/src/linkgraph/linkgraph.cpp index eee7ac61fd..532792e7c3 100644 --- a/src/linkgraph/linkgraph.cpp +++ b/src/linkgraph/linkgraph.cpp @@ -139,7 +139,7 @@ void LinkGraph::RemoveNode(NodeID id) node_edges[id] = node_edges[last_node]; } Station::Get(this->nodes[last_node].station)->goods[this->cargo].node = id; - this->nodes.Erase(this->nodes.Get(id)); + this->nodes.erase(this->nodes.begin() + id); this->edges.EraseColumn(id); /* Not doing EraseRow here, as having the extra invalid row doesn't hurt * and removing it would trigger a lot of memmove. The data has already diff --git a/src/newgrf.cpp b/src/newgrf.cpp index f80e79f7db..6ff9914413 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -637,7 +637,7 @@ static Engine *GetNewEngine(const GRFFile *file, VehicleType type, uint16 intern /* Reserve the engine slot */ if (!static_access) { - EngineIDMapping *eid = _engine_mngr.Get(engine); + EngineIDMapping *eid = _engine_mngr.data() + engine; eid->grfid = scope_grfid; // Note: this is INVALID_GRFID if dynamic_engines is disabled, so no reservation } diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp index fa84c947a4..730207c6b0 100644 --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -262,7 +262,7 @@ GRFParameterInfo::GRFParameterInfo(GRFParameterInfo &info) : complete_labels(info.complete_labels) { for (uint i = 0; i < info.value_names.size(); i++) { - SmallPair *data = info.value_names.Get(i); + SmallPair *data = info.value_names.data() + i; this->value_names.Insert(data->first, DuplicateGRFText(data->second)); } } @@ -273,7 +273,7 @@ GRFParameterInfo::~GRFParameterInfo() CleanUpGRFText(this->name); CleanUpGRFText(this->desc); for (uint i = 0; i < this->value_names.size(); i++) { - SmallPair *data = this->value_names.Get(i); + SmallPair *data = this->value_names.data() + i; CleanUpGRFText(data->second); } } diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 36a58e62eb..157d571afe 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -2133,7 +2133,7 @@ static bool AddNearbyStation(TileIndex tile, void *user_data) /* First check if there were deleted stations here */ for (uint i = 0; i < _deleted_stations_nearby.size(); i++) { - TileAndStation *ts = _deleted_stations_nearby.Get(i); + TileAndStation *ts = _deleted_stations_nearby.data() + i; if (ts->tile == tile) { *_stations_nearby_list.Append() = _deleted_stations_nearby[i].station; _deleted_stations_nearby.Erase(ts); diff --git a/src/texteff.cpp b/src/texteff.cpp index 41907e14d4..92c2017047 100644 --- a/src/texteff.cpp +++ b/src/texteff.cpp @@ -50,7 +50,7 @@ TextEffectID AddTextEffect(StringID msg, int center, int y, uint8 duration, Text } if (i == _text_effects.size()) _text_effects.Append(); - TextEffect *te = _text_effects.Get(i); + TextEffect *te = _text_effects.data() + i; /* Start defining this object */ te->string_id = msg; @@ -69,7 +69,7 @@ TextEffectID AddTextEffect(StringID msg, int center, int y, uint8 duration, Text void UpdateTextEffect(TextEffectID te_id, StringID msg) { /* Update details */ - TextEffect *te = _text_effects.Get(te_id); + TextEffect *te = _text_effects.data() + te_id; if (msg == te->string_id && GetDParam(0) == te->params_1) return; te->string_id = msg; te->params_1 = GetDParam(0);