summaryrefslogtreecommitdiff
path: root/src/order.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-30 20:40:33 +0000
committerrubidium <rubidium@openttd.org>2007-08-30 20:40:33 +0000
commit8a6cc3aa104b5f8631dcb74343dcd68ffa3308ec (patch)
tree1e96eadb775a124c36850f50c357f93af14e4be2 /src/order.h
parent9833639b00ff84b671a3943e350ed195935e31ad (diff)
downloadopenttd-8a6cc3aa104b5f8631dcb74343dcd68ffa3308ec.tar.xz
(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.
Diffstat (limited to 'src/order.h')
-rw-r--r--src/order.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/order.h b/src/order.h
index 987b36a0d..a9ccf383e 100644
--- a/src/order.h
+++ b/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;