summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2019-03-13 20:55:31 +0000
committerPeterN <peter@fuzzle.org>2019-03-26 20:15:57 +0000
commit03ca3190c9b73de3e43fe1e7e2293b8c1e3aa3d5 (patch)
tree7f7a4f88e80592b98c15465f01d9b8eb19096aa8 /src/core
parentcc62f4163f230ed82ef3b04187987d3e380cd570 (diff)
downloadopenttd-03ca3190c9b73de3e43fe1e7e2293b8c1e3aa3d5.tar.xz
Codechange: Use range-based for-loop in Auto[Free|Delete]SmallVector
Diffstat (limited to 'src/core')
-rw-r--r--src/core/smallvec_type.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp
index e71edf89f..f43265ebe 100644
--- a/src/core/smallvec_type.hpp
+++ b/src/core/smallvec_type.hpp
@@ -91,8 +91,8 @@ public:
*/
inline void Clear()
{
- for (uint i = 0; i < std::vector<T>::size(); i++) {
- free(std::vector<T>::operator[](i));
+ for (T p : *this) {
+ free(p);
}
std::vector<T>::clear();
@@ -121,8 +121,8 @@ public:
*/
inline void Clear()
{
- for (uint i = 0; i < std::vector<T>::size(); i++) {
- delete std::vector<T>::operator[](i);
+ for (T p : *this) {
+ delete p;
}
std::vector<T>::clear();