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/prerequisite.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'build2/prerequisite.cxx') 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 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 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 (*r.first)); // Update extension if the existing prerequisite has it unspecified. -- cgit v1.1