summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium42 <rubidium@openttd.org>2021-05-26 21:32:43 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-05-27 18:30:56 +0200
commit6fe4d4ad7b055393ed04d11c58bc330c539aa31e (patch)
tree8a97c8ea4b67d92ddf24f7b0731a82f16624e184 /src
parented9e38221a63133abd9caa97d1eff51a05deb4c2 (diff)
downloadopenttd-6fe4d4ad7b055393ed04d11c58bc330c539aa31e.tar.xz
Codechange: linkgraph always iterates with NodeIDs over the Size(), so make Size() the same type to prevent infinite loops
Diffstat (limited to 'src')
-rw-r--r--src/linkgraph/linkgraph.h2
-rw-r--r--src/linkgraph/linkgraphjob.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/linkgraph/linkgraph.h b/src/linkgraph/linkgraph.h
index 4f44db827..32f94a3c8 100644
--- a/src/linkgraph/linkgraph.h
+++ b/src/linkgraph/linkgraph.h
@@ -495,7 +495,7 @@ public:
* Get the current size of the component.
* @return Size.
*/
- inline uint16 Size() const { return (uint16)this->nodes.size(); }
+ inline NodeID Size() const { return (NodeID)this->nodes.size(); }
/**
* Get date of last compression.
diff --git a/src/linkgraph/linkgraphjob.h b/src/linkgraph/linkgraphjob.h
index 4913b5a35..f434fa809 100644
--- a/src/linkgraph/linkgraphjob.h
+++ b/src/linkgraph/linkgraphjob.h
@@ -332,7 +332,7 @@ public:
* Get the size of the underlying link graph.
* @return Size.
*/
- inline uint Size() const { return this->link_graph.Size(); }
+ inline NodeID Size() const { return this->link_graph.Size(); }
/**
* Get the cargo of the underlying link graph.