(svn r11009) -Codechange: unvirtualise IsValid as that isn't needed with templates. This gives up to 10% performance increase in games with lots of vehicles.
This commit is contained in:
14
src/order.h
14
src/order.h
@@ -107,7 +107,11 @@ struct Order : PoolItem<Order, OrderID, &_Order_pool> {
|
||||
Order() : refit_cargo(CT_NO_REFIT) {}
|
||||
~Order() { this->type = OT_NOTHING; }
|
||||
|
||||
bool IsValid() const;
|
||||
/**
|
||||
* Check if a Order really exists.
|
||||
*/
|
||||
inline bool IsValid() const { return this->type != OT_NOTHING; }
|
||||
|
||||
void Free();
|
||||
void FreeChain();
|
||||
};
|
||||
@@ -140,14 +144,6 @@ static inline VehicleOrderID GetNumOrders()
|
||||
return GetOrderPoolSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a Order really exists.
|
||||
*/
|
||||
inline bool Order::IsValid() const
|
||||
{
|
||||
return this->type != OT_NOTHING;
|
||||
}
|
||||
|
||||
inline void Order::Free()
|
||||
{
|
||||
this->type = OT_NOTHING;
|
||||
|
Reference in New Issue
Block a user