mirror of https://github.com/OpenTTD/OpenTTD
Fix: unused variable warnings
parent
ae532008ff
commit
e3c75a30ba
|
@ -155,7 +155,8 @@ struct Pool : PoolBase {
|
||||||
this->ValidateIndex();
|
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); }
|
T * operator*() const { return T::Get(this->index); }
|
||||||
PoolIterator & operator++() { this->index++; this->ValidateIndex(); return *this; }
|
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) {}
|
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> begin() { return PoolIterator<T>(this->from, this->filter); }
|
||||||
PoolIterator<T> end() { return PoolIterator<T>(T::GetPoolSize()); }
|
PoolIterator<T> end() { return PoolIterator<T>(T::GetPoolSize()); }
|
||||||
|
bool empty() { return this->begin() == this->end(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -99,9 +99,7 @@ extern void StateGameLoop();
|
||||||
*/
|
*/
|
||||||
bool HasClients()
|
bool HasClients()
|
||||||
{
|
{
|
||||||
for (NetworkClientSocket *cs : NetworkClientSocket::Iterate()) return true;
|
return !NetworkClientSocket::Iterate().empty();
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -182,9 +182,7 @@ RoadType AllocateRoadType(RoadTypeLabel label, RoadTramType rtt)
|
||||||
*/
|
*/
|
||||||
bool RoadVehiclesAreBuilt()
|
bool RoadVehiclesAreBuilt()
|
||||||
{
|
{
|
||||||
for (const RoadVehicle *rv : RoadVehicle::Iterate()) return true;
|
return !RoadVehicle::Iterate().empty();
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue