summaryrefslogtreecommitdiff
path: root/src/linkgraph/demands.cpp
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2021-01-08 10:16:18 +0000
committerGitHub <noreply@github.com>2021-01-08 11:16:18 +0100
commit9b800a96ed32720ff60b74e498a0e0a6351004f9 (patch)
tree3f287d339e15c4902ee415556475fd9b2918d33c /src/linkgraph/demands.cpp
parentc1fddb9a6ae5c3af6865461a7295788a341011a2 (diff)
downloadopenttd-9b800a96ed32720ff60b74e498a0e0a6351004f9.tar.xz
Codechange: Remove min/max functions in favour of STL variants (#8502)
Diffstat (limited to 'src/linkgraph/demands.cpp')
-rw-r--r--src/linkgraph/demands.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/linkgraph/demands.cpp b/src/linkgraph/demands.cpp
index f1b714820..c31e8896f 100644
--- a/src/linkgraph/demands.cpp
+++ b/src/linkgraph/demands.cpp
@@ -45,7 +45,7 @@ public:
*/
inline void SetDemandPerNode(uint num_demands)
{
- this->demand_per_node = max(this->supply_sum / num_demands, 1U);
+ this->demand_per_node = std::max(this->supply_sum / num_demands, 1U);
}
/**
@@ -57,7 +57,7 @@ public:
*/
inline uint EffectiveSupply(const Node &from, const Node &to)
{
- return max(from.Supply() * max(1U, to.Supply()) * this->mod_size / 100 / this->demand_per_node, 1U);
+ return std::max(from.Supply() * std::max(1U, to.Supply()) * this->mod_size / 100 / this->demand_per_node, 1U);
}
/**
@@ -134,7 +134,7 @@ void SymmetricScaler::SetDemands(LinkGraphJob &job, NodeID from_id, NodeID to_id
uint undelivered = job[to_id].UndeliveredSupply();
if (demand_back > undelivered) {
demand_back = undelivered;
- demand_forw = max(1U, demand_back * 100 / this->mod_size);
+ demand_forw = std::max(1U, demand_back * 100 / this->mod_size);
}
this->Scaler::SetDemands(job, to_id, from_id, demand_back);
}
@@ -230,7 +230,7 @@ void DemandCalculator::CalcDemand(LinkGraphJob &job, Tscaler scaler)
demand_forw = 1;
}
- demand_forw = min(demand_forw, job[from_id].UndeliveredSupply());
+ demand_forw = std::min(demand_forw, job[from_id].UndeliveredSupply());
scaler.SetDemands(job, from_id, to_id, demand_forw);