aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-08-24 09:18:29 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-08-24 09:18:29 +0200
commit8d0dfe5ab6df8a4521a3a5b659cb05ff8814f1eb (patch)
tree5f8fefdda99a1d1146924dcbc3afa35e40c80bfb
parent6f37af4bd815fc6b75810d07eb2f4c2e9028f9c6 (diff)
Clean group members in reverse
-rw-r--r--build2/algorithm.cxx6
1 files 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<mtime_target> ());
- const group_view& gv (g.group_members (a));
// Similar logic to clean_extra() above.
//
target_state r (target_state::unchanged);
+
if (cast_true<bool> (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<file> ().path (), *m))
r |= target_state::changed;