From e3f44dd45625795e7b4b4b9877faff6ee9c07b5b Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 2 Apr 2024 09:52:11 -0700 Subject: 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). --- src/clean.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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::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; -- cgit v0.12