aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;