diff options
author | fonsinchen <fonsinchen@openttd.org> | 2013-10-19 17:15:19 +0000 |
---|---|---|
committer | fonsinchen <fonsinchen@openttd.org> | 2013-10-19 17:15:19 +0000 |
commit | b3b460cae294ccf31b013fbd8d198939afb6abef (patch) | |
tree | 4ef819c1038ed58629f48c88dc0f920947fd1b3a /src/linkgraph/linkgraphjob.h | |
parent | c08259fe9266e41aa5ce0bc89ad49f113c436b53 (diff) | |
download | openttd-b3b460cae294ccf31b013fbd8d198939afb6abef.tar.xz |
(svn r25885) -Codechange: Keep paths sorted so that the ones with flow == 0 are in the back and don't have to be iterated over so often.
Diffstat (limited to 'src/linkgraph/linkgraphjob.h')
-rw-r--r-- | src/linkgraph/linkgraphjob.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/linkgraph/linkgraphjob.h b/src/linkgraph/linkgraphjob.h index 79231c754..66aff3672 100644 --- a/src/linkgraph/linkgraphjob.h +++ b/src/linkgraph/linkgraphjob.h @@ -45,7 +45,7 @@ private: */ struct NodeAnnotation { uint undelivered_supply; ///< Amount of supply that hasn't been distributed yet. - PathList paths; ///< Paths through this node. + PathList paths; ///< Paths through this node, sorted so that those with flow == 0 are in the back. FlowStatMap flows; ///< Planned flows to other nodes. void Init(uint supply); }; @@ -234,7 +234,8 @@ public: const FlowStatMap &Flows() const { return this->node_anno.flows; } /** - * Get the paths this node is part of. + * Get the paths this node is part of. Paths are always expected to be + * sorted so that those with flow == 0 are in the back of the list. * @return Paths. */ PathList &Paths() { return this->node_anno.paths; } |