From 8d0dfe5ab6df8a4521a3a5b659cb05ff8814f1eb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 24 Aug 2017 09:18:29 +0200 Subject: Clean group members in reverse --- build2/algorithm.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build2/algorithm.cxx b/build2/algorithm.cxx index 72e6bda..864f90c 100644 --- a/build2/algorithm.cxx +++ b/build2/algorithm.cxx @@ -1447,16 +1447,16 @@ namespace build2 perform_clean_group (action a, const target& xg) { const mtime_target& g (xg.as ()); - const group_view& gv (g.group_members (a)); // Similar logic to clean_extra() above. // target_state r (target_state::unchanged); + if (cast_true (g[var_clean])) { - for (size_t i (0); i != gv.count; ++i) + for (group_view gv (g.group_members (a)); gv.count != 0; --gv.count) { - if (const target* m = gv.members[i]) + if (const target* m = gv.members[gv.count - 1]) { if (rmfile (m->as ().path (), *m)) r |= target_state::changed; -- cgit v1.1