summaryrefslogtreecommitdiff
path: root/src/sortlist_type.h
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2018-09-25 22:01:05 +0100
committerPeterN <peter@fuzzle.org>2019-03-26 20:15:57 +0000
commitca2f33c6d025c0c45fb4bc472493290445312de5 (patch)
treecf39f3f0a815778049c037d80f0b86a11f1af665 /src/sortlist_type.h
parent097328c3d73520834b4ef801945c4f57f9eca0cd (diff)
downloadopenttd-ca2f33c6d025c0c45fb4bc472493290445312de5.tar.xz
Codechange: Replaced SmallVector::Erase() with std::vector::erase()
Diffstat (limited to 'src/sortlist_type.h')
-rw-r--r--src/sortlist_type.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/sortlist_type.h b/src/sortlist_type.h
index 74b6f37b3..23a558018 100644
--- a/src/sortlist_type.h
+++ b/src/sortlist_type.h
@@ -337,13 +337,12 @@ public:
if (!(this->flags & VL_FILTER)) return false;
bool changed = false;
- for (uint iter = 0; iter < std::vector<T>::size();) {
- T *item = &std::vector<T>::operator[](iter);
- if (!decide(item, filter_data)) {
- this->Erase(item);
+ for (auto it = std::vector<T>::begin(); it != std::vector<T>::end(); /* Nothing */) {
+ if (!decide(&*it, filter_data)) {
+ it = std::vector<T>::erase(it);
changed = true;
} else {
- iter++;
+ it++;
}
}