diff options
author | Evan Martin <martine@danga.com> | 2011-12-07 16:45:16 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-12-07 16:47:38 (GMT) |
commit | c6144ccfe366b694bf034bdafa07e7c47ac8bf30 (patch) | |
tree | e373660d4da9ba0b55a05cf719e28d6dd91f5a68 /src/state.cc | |
parent | 276f2b319188ea905ebfc39ebaab684a2255c012 (diff) | |
download | Ninja-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.cc | 15 |
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) { |