summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2024-04-02 16:52:11 (GMT)
committerDylan Baker <dylan@pnwbakers.com>2024-04-02 18:52:18 (GMT)
commite3f44dd45625795e7b4b4b9877faff6ee9c07b5b (patch)
treea89864bcbb0c528bf412d70484d7dae95757bf48 /src
parent003bb3b32f6f42c45f9eb51881a52ee2c370b522 (diff)
downloadNinja-e3f44dd45625795e7b4b4b9877faff6ee9c07b5b.zip
Ninja-e3f44dd45625795e7b4b4b9877faff6ee9c07b5b.tar.gz
Ninja-e3f44dd45625795e7b4b4b9877faff6ee9c07b5b.tar.bz2
clean: Improve performance in presence of dynamic dependencies
Add code to check "pending" so as to avoid loading dyndep files that have already been loaded. This was missed by commit a3cbb4d (clean: remove outputs specified by dyndep files, 2019-02-12, v1.10.0~1^2~53^2~4).
Diffstat (limited to 'src')
-rw-r--r--src/clean.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/clean.cc b/src/clean.cc
index 6827352..ceffe64 100644
--- a/src/clean.cc
+++ b/src/clean.cc
@@ -293,7 +293,8 @@ void Cleaner::LoadDyndeps() {
// Load dyndep files that exist, before they are cleaned.
for (vector<Edge*>::iterator e = state_->edges_.begin();
e != state_->edges_.end(); ++e) {
- if (Node* dyndep = (*e)->dyndep_) {
+ Node* dyndep;
+ if ((dyndep = (*e)->dyndep_) && dyndep->dyndep_pending()) {
// Capture and ignore errors loading the dyndep file.
// We clean as much of the graph as we know.
std::string err;