From 4bab5c56cd1c91a928af73e0d428d8cc361600f4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 2 Jul 2020 07:51:07 +0200 Subject: Cache project name in root_extra --- libbuild2/scope.ixx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libbuild2/scope.ixx') diff --git a/libbuild2/scope.ixx b/libbuild2/scope.ixx index a3a417f..01d239b 100644 --- a/libbuild2/scope.ixx +++ b/libbuild2/scope.ixx @@ -162,8 +162,11 @@ namespace build2 inline const project_name& project (const scope& rs) { - auto l (rs[rs.ctx.var_project]); - return l ? cast (l) : empty_project_name; + assert (rs.root_extra != nullptr && rs.root_extra->project); + + return *rs.root_extra->project != nullptr + ? **rs.root_extra->project + : empty_project_name; } inline const project_name& -- cgit v1.1