# HG changeset patch # User Henry Wilson # Date 2018-09-24 19:18:16 # Node ID e8acc751d575fa6c71a4936c993085ebab807bc6 # Parent 2509ad7a562c41d8a45a369f549498e5866d11e2 Codechange: Replaced SmallVector::ErasePreservingOrder(it, count) with std::vector::erase() diff --git a/src/animated_tile.cpp b/src/animated_tile.cpp --- a/src/animated_tile.cpp +++ b/src/animated_tile.cpp @@ -27,10 +27,10 @@ SmallVector _animated_ti */ void DeleteAnimatedTile(TileIndex tile) { - TileIndex *to_remove = &*std::find(_animated_tiles.begin(), _animated_tiles.end(), tile); - if (to_remove != _animated_tiles.End()) { + auto to_remove = std::find(_animated_tiles.begin(), _animated_tiles.end(), tile); + if (to_remove != _animated_tiles.end()) { /* The order of the remaining elements must stay the same, otherwise the animation loop may miss a tile. */ - _animated_tiles.ErasePreservingOrder(to_remove); + _animated_tiles.erase(to_remove); MarkTileDirtyByTile(tile); } } diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -149,16 +149,6 @@ public: } /** - * Remove items from the vector while preserving the order of other items. - * @param item First item to remove. - * @param count Number of consecutive items to remove. - */ - inline void ErasePreservingOrder(T *item, uint count = 1) - { - this->ErasePreservingOrder(item - this->Begin(), count); - } - - /** * Tests whether a item is present in the vector, and appends it to the end if not. * The '!=' operator of T is used for comparison. * @param item Item to test for