summaryrefslogtreecommitdiffstats
path: root/src/state.h
diff options
context:
space:
mode:
authorRobert Iannucci <robbie@rail.com>2013-03-18 17:36:23 (GMT)
committerRobert Iannucci <robbie@rail.com>2013-03-18 17:36:23 (GMT)
commit8e70a53058a74d3582c609fd9f7c133dae7387b4 (patch)
tree941b9a9643cc3fec5a8c86e341059f40f2a9847e /src/state.h
parent72b3dae6aa936e9eabf4c22e5602c572a9756cbe (diff)
downloadNinja-8e70a53058a74d3582c609fd9f7c133dae7387b4.zip
Ninja-8e70a53058a74d3582c609fd9f7c133dae7387b4.tar.gz
Ninja-8e70a53058a74d3582c609fd9f7c133dae7387b4.tar.bz2
Fix Pool to use a set internally
Diffstat (limited to 'src/state.h')
-rw-r--r--src/state.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/state.h b/src/state.h
index 0a2e890..279a64a 100644
--- a/src/state.h
+++ b/src/state.h
@@ -39,7 +39,7 @@ struct Rule;
/// completes).
struct Pool {
explicit Pool(const string& name, int depth)
- : name_(name), current_use_(0), depth_(depth) { }
+ : name_(name), current_use_(0), depth_(depth), delayed_(&WeightedEdgeCmp) { }
// A depth of 0 is infinite
bool is_valid() const { return depth_ >= 0; }
@@ -74,7 +74,9 @@ struct Pool {
int current_use_;
int depth_;
- deque<Edge*> delayed_;
+ static bool WeightedEdgeCmp(const Edge* a, const Edge* b);
+
+ set<Edge*,bool(*)(const Edge*, const Edge*)> delayed_;
};
/// Global state (file status, loaded rules) for a single run.