summaryrefslogtreecommitdiff
path: root/src/linkgraph/linkgraph.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/linkgraph/linkgraph.cpp')
-rw-r--r--src/linkgraph/linkgraph.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/linkgraph/linkgraph.cpp b/src/linkgraph/linkgraph.cpp
index 5185d07b7..93af907fc 100644
--- a/src/linkgraph/linkgraph.cpp
+++ b/src/linkgraph/linkgraph.cpp
@@ -71,7 +71,7 @@ void LinkGraph::Compress()
for (NodeID node2 = 0; node2 < this->Size(); ++node2) {
BaseEdge &edge = this->edges[node1][node2];
if (edge.capacity > 0) {
- edge.capacity = max(1U, edge.capacity / 2);
+ edge.capacity = std::max(1U, edge.capacity / 2);
edge.usage /= 2;
}
}
@@ -163,8 +163,7 @@ NodeID LinkGraph::AddNode(const Station *st)
this->nodes.emplace_back();
/* Avoid reducing the height of the matrix as that is expensive and we
* most likely will increase it again later which is again expensive. */
- this->edges.Resize(new_node + 1U,
- max(new_node + 1U, this->edges.Height()));
+ this->edges.Resize(new_node + 1U, std::max(new_node + 1U, this->edges.Height()));
this->nodes[new_node].Init(st->xy, st->index,
HasBit(good.status, GoodsEntry::GES_ACCEPTANCE));
@@ -266,8 +265,8 @@ void LinkGraph::Edge::Update(uint capacity, uint usage, EdgeUpdateMode mode)
this->edge.capacity += capacity;
this->edge.usage += usage;
} else if (mode & EUM_REFRESH) {
- this->edge.capacity = max(this->edge.capacity, capacity);
- this->edge.usage = max(this->edge.usage, usage);
+ this->edge.capacity = std::max(this->edge.capacity, capacity);
+ this->edge.usage = std::max(this->edge.usage, usage);
}
if (mode & EUM_UNRESTRICTED) this->edge.last_unrestricted_update = _date;
if (mode & EUM_RESTRICTED) this->edge.last_restricted_update = _date;