(svn r10744) -Codechange: make the pool a little more OO, so it can be easier in other places.

This commit is contained in:
rubidium
2007-08-01 22:10:54 +00:00
parent 435d39f8fb
commit 4e96ce3dfe
5 changed files with 79 additions and 60 deletions

View File

@@ -171,13 +171,9 @@ static inline bool HasOrderPoolFree(uint amount)
const Order *order;
/* There is always room if not all blocks in the pool are reserved */
if (_Order_pool.current_blocks < _Order_pool.max_blocks)
return true;
if (_Order_pool.CanAllocateMoreBlocks()) return true;
FOR_ALL_ORDERS(order)
if (!order->IsValid())
if (--amount == 0)
return true;
FOR_ALL_ORDERS(order) if (!order->IsValid() && --amount == 0) return true;
return false;
}