diff --git a/src/pathfinder/yapf/yapf_destrail.hpp b/src/pathfinder/yapf/yapf_destrail.hpp index 2af7805528..fd4a0e9657 100644 --- a/src/pathfinder/yapf/yapf_destrail.hpp +++ b/src/pathfinder/yapf/yapf_destrail.hpp @@ -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); } /** diff --git a/src/pathfinder/yapf/yapf_rail.cpp b/src/pathfinder/yapf/yapf_rail.cpp index 679cc153e2..133a61754f 100644 --- a/src/pathfinder/yapf/yapf_rail.cpp +++ b/src/pathfinder/yapf/yapf_rail.cpp @@ -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; } };