From dfb74e25f7ac41c80b3a2d9f4443b3a89d320900 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Thu, 24 Oct 2024 17:13:29 +0200 Subject: [PATCH] Codechange: remove parameter which value can always be deduced --- src/roadstop.cpp | 8 +++----- src/roadstop_base.h | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/roadstop.cpp b/src/roadstop.cpp index 7fa254ccfa..68281498e9 100644 --- a/src/roadstop.cpp +++ b/src/roadstop.cpp @@ -360,17 +360,15 @@ static DiagDirection GetEntryDirection(bool east, Axis axis) /** * Rebuild, from scratch, the vehicles and other metadata on this stop. * @param rs the roadstop this entry is part of - * @param side the side of the road stop to look at */ -void RoadStop::Entry::Rebuild(const RoadStop *rs, int side) +void RoadStop::Entry::Rebuild(const RoadStop *rs) { assert(HasBit(rs->status, RSSFB_BASE_ENTRY)); Axis axis = GetDriveThroughStopAxis(rs->xy); - if (side == -1) side = (rs->east == this); RoadStopEntryRebuilderHelper rserh; - rserh.dir = GetEntryDirection(side, axis); + rserh.dir = GetEntryDirection(rs->east == this, axis); this->length = 0; TileIndexDiff offset = TileOffsByAxis(axis); @@ -399,6 +397,6 @@ void RoadStop::Entry::CheckIntegrity(const RoadStop *rs) const assert(!IsDriveThroughRoadStopContinuation(rs->xy, rs->xy - TileOffsByAxis(GetDriveThroughStopAxis(rs->xy)))); Entry temp; - temp.Rebuild(rs, rs->east == this); + temp.Rebuild(rs); if (temp.length != this->length || temp.occupied != this->occupied) NOT_REACHED(); } diff --git a/src/roadstop_base.h b/src/roadstop_base.h index 1213773646..81cba1755e 100644 --- a/src/roadstop_base.h +++ b/src/roadstop_base.h @@ -61,7 +61,7 @@ struct RoadStop : RoadStopPool::PoolItem<&_roadstop_pool> { void Leave(const RoadVehicle *rv); void Enter(const RoadVehicle *rv); void CheckIntegrity(const RoadStop *rs) const; - void Rebuild(const RoadStop *rs, int side = -1); + void Rebuild(const RoadStop *rs); }; uint8_t status; ///< Current status of the Stop, @see RoadStopSatusFlag. Access using *Bay and *Busy functions.