aboutsummaryrefslogtreecommitdiff
path: root/build2/file.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-01-19 12:45:04 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-01-19 12:45:04 +0200
commit5607313a91e5ca0113b1f8b9acfd02c1fb105346 (patch)
treeb14fd2737b88f90e9d142d8e6eff36876e0f8b5a /build2/file.cxx
parent8ecc2d18bf86b1021a31a2e5d01e71afbaa1efd0 (diff)
Get rid of project_name_pool
With small string optimizations this is most likely a hindrance rather that an optimization.
Diffstat (limited to 'build2/file.cxx')
-rw-r--r--build2/file.cxx16
1 files changed, 8 insertions, 8 deletions
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.