From b1f5119d3af2fb47a2f1c752d61a742f41076451 Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Mon, 24 Sep 2018 20:24:40 +0100 Subject: [PATCH] Codechange: Replaced SmallVector::ErasePreservingOrder(pos, count) with std::vector::erase() --- src/core/smallvec_type.hpp | 11 ----------- src/vehicle_gui.cpp | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 7d856ca9ba..5225d13da4 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -137,17 +137,6 @@ public: std::vector::pop_back(); } - /** - * Remove items from the vector while preserving the order of other items. - * @param pos First item to remove. - * @param count Number of consecutive items to remove. - */ - void ErasePreservingOrder(uint pos, uint count = 1) - { - auto const it = std::vector::begin() + pos; - std::vector::erase(it, it + 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. diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 95f0a28ec7..6dd4bef336 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -494,7 +494,7 @@ struct RefitWindow : public Window { while (pos < l.size() && l[pos].subtype != refit_cyc) pos++; if (pos < l.size() && l[pos].string != subtype) { /* String mismatch, remove item keeping the order */ - l.ErasePreservingOrder(pos); + l.erase(l.begin() + pos); } } }