From 5607313a91e5ca0113b1f8b9acfd02c1fb105346 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 19 Jan 2017 12:45:04 +0200 Subject: Get rid of project_name_pool With small string optimizations this is most likely a hindrance rather that an optimization. --- build2/file.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'build2/file.cxx') diff --git a/build2/file.cxx b/build2/file.cxx index cc1be77..9e957a9 100644 --- a/build2/file.cxx +++ b/build2/file.cxx @@ -826,19 +826,19 @@ namespace build2 l5 ([&]{trace << target << " from " << ibase.out_path ();}); // If there is no project specified for this target, then our run will be - // short and sweet: we simply return it as empty- project-qualified and + // short and sweet: we simply return it as empty-project-qualified and // let someone else (e.g., a rule) take a stab at it. // if (target.unqualified ()) { - target.proj = &project_name_pool.find (""); + target.proj = string (); return names {move (target)}; } // Otherwise, get the project name and convert the target to unqualified. // - const string& proj (*target.proj); - target.proj = nullptr; + string proj (move (*target.proj)); + target.proj = nullopt; scope& iroot (*ibase.root_scope ()); @@ -873,7 +873,7 @@ namespace build2 // if (out_root.empty ()) { - target.proj = &proj; + target.proj = move (proj); l5 ([&]{trace << "skipping " << target;}); return names {move (target)}; } @@ -924,7 +924,7 @@ namespace build2 // config.import.build2.b=b-boot // if (p.relative ()) - target.proj = &proj; + target.proj = move (proj); target.dir = p.directory (); target.value = p.leaf ().string (); @@ -973,7 +973,7 @@ namespace build2 // if (out_root.empty ()) { - target.proj = &proj; + target.proj = move (proj); l5 ([&]{trace << "postponing " << target;}); return names {move (target)}; } @@ -1098,7 +1098,7 @@ namespace build2 { tracer trace ("import"); - assert (pk.proj != nullptr); + assert (pk.proj); const string& p (*pk.proj); // Target type-specific search. -- cgit v1.1