aboutsummaryrefslogtreecommitdiff
path: root/build2/prerequisite.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/prerequisite.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/prerequisite.cxx')
-rw-r--r--build2/prerequisite.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/build2/prerequisite.cxx b/build2/prerequisite.cxx
index 5bb2ddf..82d6ea2 100644
--- a/build2/prerequisite.cxx
+++ b/build2/prerequisite.cxx
@@ -15,10 +15,12 @@ namespace build2
{
// prerequisite_key
//
+ const optional<string> prerequisite_key::nullproj = nullopt;
+
ostream&
operator<< (ostream& os, const prerequisite_key& pk)
{
- if (pk.proj != nullptr)
+ if (pk.proj)
os << *pk.proj << '%';
//
// Don't print scope if we are project-qualified or the prerequisite's
@@ -49,7 +51,7 @@ namespace build2
// prerequisite_set
//
auto prerequisite_set::
- insert (const string* proj,
+ insert (optional<string> proj,
const target_type& tt,
dir_path dir,
dir_path out,
@@ -64,7 +66,8 @@ namespace build2
// Find or insert.
//
- auto r (emplace (proj, tt, move (dir), move (out), move (name), ext, s));
+ auto r (
+ emplace (move (proj), tt, move (dir), move (out), move (name), ext, s));
prerequisite& p (const_cast<prerequisite&> (*r.first));
// Update extension if the existing prerequisite has it unspecified.