1
0
Fork 0

Codechange: Remove some unnecessary local variables.

pull/13030/head
Peter Nelson 2024-10-21 20:25:04 +01:00 committed by Peter Nelson
parent c39554a210
commit e50c1774fc
2 changed files with 4 additions and 9 deletions

View File

@ -58,8 +58,7 @@ public:
/** Called by YAPF to detect if node ends in the desired destination */ /** Called by YAPF to detect if node ends in the desired destination */
inline bool PfDetectDestination(TileIndex tile, Trackdir) inline bool PfDetectDestination(TileIndex tile, Trackdir)
{ {
bool bDest = IsRailDepotTile(tile); return IsRailDepotTile(tile);
return bDest;
} }
/** /**

View File

@ -353,8 +353,7 @@ public:
Yapf().SetOrigin(t1, td); Yapf().SetOrigin(t1, td);
Yapf().SetDestination(v, override_railtype); Yapf().SetDestination(v, override_railtype);
bool bFound = Yapf().FindPath(v); if (!Yapf().FindPath(v)) return false;
if (!bFound) return false;
/* Found a destination, set as reservation target. */ /* Found a destination, set as reservation target. */
Node *pNode = Yapf().GetBestNode(); Node *pNode = Yapf().GetBestNode();
@ -506,9 +505,7 @@ public:
Yapf().SetDestination(v); Yapf().SetDestination(v);
/* find the best path */ /* find the best path */
bool bFound = Yapf().FindPath(v); if (!Yapf().FindPath(v)) return false;
if (!bFound) return false;
/* path was found /* path was found
* walk through the path back to the origin */ * walk through the path back to the origin */
@ -518,8 +515,7 @@ public:
} }
/* check if it was reversed origin */ /* check if it was reversed origin */
Node &best_org_node = *pNode; bool reversed = (pNode->cost != 0);
bool reversed = (best_org_node.cost != 0);
return reversed; return reversed;
} }
}; };