Changeset - r25522:f57895b89775
[Not reviewed]
master
0 2 0
rubidium42 - 3 years ago 2021-05-26 19:32:43
rubidium@openttd.org
Codechange: linkgraph always iterates with NodeIDs over the Size(), so make Size() the same type to prevent infinite loops
2 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/linkgraph/linkgraph.h
Show inline comments
 
@@ -492,13 +492,13 @@ public:
 
	inline ConstNode operator[](NodeID num) const { return ConstNode(this, num); }
 

	
 
	/**
 
	 * 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.
 
	 * @return Date of last compression.
 
	 */
 
	inline Date LastCompression() const { return this->last_compression; }
src/linkgraph/linkgraphjob.h
Show inline comments
 
@@ -329,13 +329,13 @@ public:
 
	inline Node operator[](NodeID num) { return Node(this, num); }
 

	
 
	/**
 
	 * 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.
 
	 * @return Cargo.
 
	 */
 
	inline CargoID Cargo() const { return this->link_graph.Cargo(); }
0 comments (0 inline, 0 general)