diff options
author | Igor [hyperxor] <56217938+hyperxor@users.noreply.github.com> | 2022-06-20 06:45:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-20 06:45:29 (GMT) |
commit | d4017a2b1ea642f12dabe05ec99b2a16c93e99aa (patch) | |
tree | d617379418d5270026366322c948a98bd03e6e40 | |
parent | a4c24a33c1ed32d9d51c8df763ec6ad574587d02 (diff) | |
download | Ninja-d4017a2b1ea642f12dabe05ec99b2a16c93e99aa.zip Ninja-d4017a2b1ea642f12dabe05ec99b2a16c93e99aa.tar.gz Ninja-d4017a2b1ea642f12dabe05ec99b2a16c93e99aa.tar.bz2 |
Make IsDepsEntryLiveFor static and add const to parameter (#2141)
-rw-r--r-- | src/deps_log.cc | 2 | ||||
-rw-r--r-- | src/deps_log.h | 2 | ||||
-rw-r--r-- | src/ninja.cc | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/deps_log.cc b/src/deps_log.cc index 7e48b38..e32a7a9 100644 --- a/src/deps_log.cc +++ b/src/deps_log.cc @@ -361,7 +361,7 @@ bool DepsLog::Recompact(const string& path, string* err) { return true; } -bool DepsLog::IsDepsEntryLiveFor(Node* node) { +bool DepsLog::IsDepsEntryLiveFor(const Node* node) { // Skip entries that don't have in-edges or whose edges don't have a // "deps" attribute. They were in the deps log from previous builds, but // the the files they were for were removed from the build and their deps diff --git a/src/deps_log.h b/src/deps_log.h index 09cc41c..2a1b188 100644 --- a/src/deps_log.h +++ b/src/deps_log.h @@ -97,7 +97,7 @@ struct DepsLog { /// past but are no longer part of the manifest. This function returns if /// this is the case for a given node. This function is slow, don't call /// it from code that runs on every build. - bool IsDepsEntryLiveFor(Node* node); + static bool IsDepsEntryLiveFor(const Node* node); /// Used for tests. const std::vector<Node*>& nodes() const { return nodes_; } diff --git a/src/ninja.cc b/src/ninja.cc index 834e284..9ae53de 100644 --- a/src/ninja.cc +++ b/src/ninja.cc @@ -532,7 +532,7 @@ int NinjaMain::ToolDeps(const Options* options, int argc, char** argv) { if (argc == 0) { for (vector<Node*>::const_iterator ni = deps_log_.nodes().begin(); ni != deps_log_.nodes().end(); ++ni) { - if (deps_log_.IsDepsEntryLiveFor(*ni)) + if (DepsLog::IsDepsEntryLiveFor(*ni)) nodes.push_back(*ni); } } else { |