diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2024-10-29 15:12:28 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2024-10-29 15:12:28 +0200 |
commit | 95da67852e7c837592a61fb44cd8acd325d16ba2 (patch) | |
tree | d4fadf2f46d11264e3c9dc347ddc944162a30632 /libbuild2 | |
parent | 042a541b08d306e846085fa1ca42d533a6f61734 (diff) |
Minor performance optimization
Diffstat (limited to 'libbuild2')
-rw-r--r-- | libbuild2/target.ixx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libbuild2/target.ixx b/libbuild2/target.ixx index 47dff3d..f8ee975 100644 --- a/libbuild2/target.ixx +++ b/libbuild2/target.ixx @@ -491,12 +491,14 @@ namespace build2 // inline group_prerequisites:: group_prerequisites (const target& t) - : t_ (t), - g_ (t_.group == nullptr || - t_.group->adhoc_member != nullptr || // Ad hoc group member. - t_.group->prerequisites ().empty () - ? nullptr : t_.group) + : t_ (t), g_ (nullptr) { + if (const target* g = t_.group) + { + if (g->adhoc_member == nullptr && // Not ad hoc group member. + !g->prerequisites ().empty ()) + g_ = g; + } } inline group_prerequisites:: |