(svn r12309) [NoAI] -Codechange: optimize a little bit (a very small little bit, but every bit counts :) ) (glx)
#include "ai_bridgelist.hpp"
#include "../../bridge.h"
#include "../../date_func.h"
AIBridgeList::AIBridgeList()
{
/* Add all bridges, no matter if they are available or not */
for (byte j = 0; j < MAX_BRIDGES; j++)
if (::GetBridgeSpec(j)->avail_year <= _cur_year)
this->AddItem(j);
}
AIBridgeList_Length::AIBridgeList_Length(uint length)
{
for (byte j = 0; j < MAX_BRIDGES; j++)
if (::GetBridgeSpec(j)->avail_year <= _cur_year)
if (length >= ::GetBridgeSpec(j)->min_length && length <= ::GetBridgeSpec(j)->max_length)
this->AddItem(j);
}