diff options
author | glx <glx@openttd.org> | 2019-12-18 18:21:23 +0100 |
---|---|---|
committer | Niels Martin Hansen <nielsm@indvikleren.dk> | 2019-12-21 20:13:03 +0100 |
commit | e3c75a30bac6837c0a525aa58d2b966eb232650f (patch) | |
tree | bab4c09231cfa51544f10b9c0f22f4899993fc86 /src/core | |
parent | ae532008ff3bc4195989e5c0ab2a9733473360ac (diff) | |
download | openttd-e3c75a30bac6837c0a525aa58d2b966eb232650f.tar.xz |
Fix: unused variable warnings
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/pool_type.hpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/pool_type.hpp b/src/core/pool_type.hpp index 0dba9a0b4..035607a8f 100644 --- a/src/core/pool_type.hpp +++ b/src/core/pool_type.hpp @@ -155,7 +155,8 @@ struct Pool : PoolBase { this->ValidateIndex(); }; - bool operator!=(const PoolIterator &other) const { return this->index != other.index; } + bool operator==(const PoolIterator &other) const { return this->index == other.index; } + bool operator!=(const PoolIterator &other) const { return !(*this == other); } T * operator*() const { return T::Get(this->index); } PoolIterator & operator++() { this->index++; this->ValidateIndex(); return *this; } @@ -176,6 +177,7 @@ struct Pool : PoolBase { IterateWrapper(size_t from = 0, std::function<bool(size_t)> filter = nullptr) : from(from), filter(filter) {} PoolIterator<T> begin() { return PoolIterator<T>(this->from, this->filter); } PoolIterator<T> end() { return PoolIterator<T>(T::GetPoolSize()); } + bool empty() { return this->begin() == this->end(); } }; /** |