Skip to content

Commit

Permalink
Make IsDepsEntryLiveFor static and add const to parameter (#2141)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperxor committed Jun 20, 2022
1 parent a4c24a3 commit d4017a2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/deps_log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/deps_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_; }
Expand Down
2 changes: 1 addition & 1 deletion src/ninja.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d4017a2

Please sign in to comment.