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/test/target.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'build2/test') diff --git a/build2/test/target.cxx b/build2/test/target.cxx index af3c89b..44f65aa 100644 --- a/build2/test/target.cxx +++ b/build2/test/target.cxx @@ -16,21 +16,21 @@ namespace build2 dir_path d, dir_path o, string n, - const string* e) + optional e) { - if (e == nullptr) - e = &extension_pool.find (n == "testscript" ? "" : "test"); + if (!e) + e = (n == "testscript" ? string () : "test"); - return new testscript (move (d), move (o), move (n), e); + return new testscript (move (d), move (o), move (n), move (e)); } - static const string* + static optional testscript_target_extension (const target_key& tk, scope&, bool) { // If the name is special 'testscript', then there is no extension, // otherwise it is .test. // - return &extension_pool.find (*tk.name == "testscript" ? "" : "test"); + return *tk.name == "testscript" ? string () : "test"; } const target_type testscript::static_type -- cgit v1.1