From 5164c843513212ab1ac1f721c4de04b6a865eb0c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 19 Jan 2017 16:50:40 +0200 Subject: Get rid of extension_pool --- build2/target.txx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'build2/target.txx') diff --git a/build2/target.txx b/build2/target.txx index bc63c75..66acfb8 100644 --- a/build2/target.txx +++ b/build2/target.txx @@ -3,7 +3,6 @@ // license : MIT; see accompanying LICENSE file #include -#include // extension_pool #include #include @@ -34,14 +33,14 @@ namespace build2 // // template - const string* + optional target_extension_fix (const target_key&, scope&, bool) { - return &extension_pool.find (ext); + return string (ext); } template - const string* + optional target_extension_var (const target_key& tk, scope& s, bool) { // Include target type/pattern-specific variables. @@ -51,10 +50,9 @@ namespace build2 // Help the user here and strip leading '.' from the extension. // const string& e (cast (l)); - return &extension_pool.find ( - !e.empty () && e.front () == '.' ? string (e, 1) : e); + return !e.empty () && e.front () == '.' ? string (e, 1) : e; } - return def != nullptr ? &extension_pool.find (def) : nullptr; + return def != nullptr ? optional (def) : nullopt; } } -- cgit v1.1