Skip to content

Commit

Permalink
-const
Browse files Browse the repository at this point in the history
-noexcept
  • Loading branch information
geoffthemedio committed Apr 20, 2024
1 parent 318f75c commit 33253e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions universe/Fleet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,13 @@ std::vector<MovePathNode> Fleet::MovePath(const std::vector<int>& route, bool fl
auto empire = context.GetEmpire(this->Owner());
const auto fleet_supplied_systems = context.supply.FleetSupplyableSystemIDs(
this->Owner(), ALLOW_ALLIED_SUPPLY, context);
auto& unobstructed_systems = empire ? empire->SupplyUnobstructedSystems() : EMPTY_SET;
const auto& unobstructed_systems = empire ? empire->SupplyUnobstructedSystems() : EMPTY_SET;

// determine if, given fuel available and supplyable systems, fleet will ever be able to move
if (fuel < 1.0f &&
this->SystemID() != INVALID_OBJECT_ID &&
std::none_of(fleet_supplied_systems.begin(), fleet_supplied_systems.end(),
[sys_id{this->SystemID()}] (const auto fss) { return fss == sys_id; }))
[sys_id{this->SystemID()}] (const int fss) noexcept { return fss == sys_id; }))
{
// no fuel and out of supply => can't move => path is just this system with explanatory ETA
retval.emplace_back(this->X(), this->Y(), true, ETA_OUT_OF_RANGE, this->SystemID(),
Expand Down

0 comments on commit 33253e3

Please sign in to comment.