From 57abb0703ec640fdcd0b0ac165f742bbc34df533 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 14 Jun 2017 13:06:38 +0200 Subject: Next installment in C++ modules saga: module search, re-export support --- build2/algorithm.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'build2/algorithm.cxx') diff --git a/build2/algorithm.cxx b/build2/algorithm.cxx index 658a6cd..9310644 100644 --- a/build2/algorithm.cxx +++ b/build2/algorithm.cxx @@ -1089,20 +1089,26 @@ namespace build2 pair, const target*> execute_prerequisites (const target_type* tt, action a, const target& t, - const timestamp& mt, const prerequisite_filter& pf) + const timestamp& mt, const prerequisite_filter& pf, + size_t n) { assert (current_mode == execution_mode::first); auto& pts (const_cast (t).prerequisite_targets); // MT-aware. + if (n == 0) + n = pts.size (); + // Pretty much as straight_execute_members() but hairier. // target_state rs (target_state::unchanged); wait_guard wg (target::count_busy (), t.task_count); - for (const target*& pt : pts) + for (size_t i (0); i != n; ++i) { + const target*& pt (pts[i]); + if (pt == nullptr) // Skipped. continue; @@ -1124,8 +1130,10 @@ namespace build2 bool e (mt == timestamp_nonexistent); const target* rt (tt != nullptr ? nullptr : &t); - for (const target*& pt : pts) + for (size_t i (0); i != n; ++i) { + const target*& pt (pts[i]); + if (pt == nullptr) continue; -- cgit v1.1