summaryrefslogtreecommitdiffstats
path: root/src/state.cc
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2011-12-07 16:45:16 (GMT)
committerEvan Martin <martine@danga.com>2011-12-07 16:47:38 (GMT)
commitc6144ccfe366b694bf034bdafa07e7c47ac8bf30 (patch)
treee373660d4da9ba0b55a05cf719e28d6dd91f5a68 /src/state.cc
parent276f2b319188ea905ebfc39ebaab684a2255c012 (diff)
downloadNinja-c6144ccfe366b694bf034bdafa07e7c47ac8bf30.zip
Ninja-c6144ccfe366b694bf034bdafa07e7c47ac8bf30.tar.gz
Ninja-c6144ccfe366b694bf034bdafa07e7c47ac8bf30.tar.bz2
merge FileStat into Node
The two were always one-to-one anyway. I started adding accessors to FileStat and then realized most users wanted them on Node and that forwarding them through was silly.
Diffstat (limited to 'src/state.cc')
-rw-r--r--src/state.cc15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/state.cc b/src/state.cc
index 9519856..bbb2f6a 100644
--- a/src/state.cc
+++ b/src/state.cc
@@ -46,24 +46,15 @@ Edge* State::AddEdge(const Rule* rule) {
}
Node* State::GetNode(const string& path) {
- FileStat* file = stat_cache_.GetFile(path);
- if (!file->node_)
- file->node_ = new Node(file);
- return file->node_;
+ return stat_cache_.GetFile(path);
}
Node* State::LookupNode(const string& path) {
- FileStat* file = stat_cache_.GetFile(path);
- if (!file->node_)
- return NULL;
- return file->node_;
+ return stat_cache_.LookupFile(path);
}
Node* State::SpellcheckNode(const string& path) {
- FileStat* file = stat_cache_.SpellcheckFile(path);
- if (!file || !file->node_)
- return NULL;
- return file->node_;
+ return stat_cache_.SpellcheckFile(path);
}
void State::AddIn(Edge* edge, const string& path) {