aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build2/cc/compile-rule.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/build2/cc/compile-rule.cxx b/build2/cc/compile-rule.cxx
index d2ed278..dd187ba 100644
--- a/build2/cc/compile-rule.cxx
+++ b/build2/cc/compile-rule.cxx
@@ -1232,11 +1232,9 @@ namespace build2
// This is like prerequisite search.
//
- if (optional<string> de = tt.default_extension (tk, s, nullptr, true))
- if (*de == e)
- return true;
+ optional<string> de (tt.default_extension (tk, s, nullptr, true));
- return false;
+ return de && *de == e;
};
small_vector<const target_type*, 2> r;