(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:
rubidium
2007-08-30 20:40:33 +00:00
parent 9833639b00
commit 8a6cc3aa10
12 changed files with 23 additions and 47 deletions

View File

@@ -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;