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 */
inline bool PfDetectDestination(TileIndex tile, Trackdir)
{
bool bDest = IsRailDepotTile(tile);
return bDest;
return IsRailDepotTile(tile);
}
/**

View File

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