aboutsummaryrefslogtreecommitdiff
path: root/build2/target-key
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-01-19 16:50:40 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-01-19 16:50:40 +0200
commit5164c843513212ab1ac1f721c4de04b6a865eb0c (patch)
tree1c6b2f440bd6dcd41fed60e76095bae2bf4e9e54 /build2/target-key
parent5607313a91e5ca0113b1f8b9acfd02c1fb105346 (diff)
Get rid of extension_pool
Diffstat (limited to 'build2/target-key')
-rw-r--r--build2/target-key9
1 files changed, 5 insertions, 4 deletions
diff --git a/build2/target-key b/build2/target-key
index f0ea80b..7905f8a 100644
--- a/build2/target-key
+++ b/build2/target-key
@@ -26,7 +26,9 @@ namespace build2
const dir_path* const dir; // Can be relative if part of prerequisite_key.
const dir_path* const out; // Can be relative if part of prerequisite_key.
const string* const name;
- const string* const& ext;
+ const optional<string>& ext;
+
+ static const optional<string> nullext;
template <typename T>
bool is_a () const {return type->is_a<T> ();}
@@ -47,15 +49,14 @@ namespace build2
inline bool
operator== (const target_key& x, const target_key& y)
{
- // Unspecified and specified extension are assumed equal. The extension
- // strings are from the pool, so we can just compare pointers.
+ // Unspecified and specified extension are assumed equal.
//
return
x.type == y.type &&
*x.dir == *y.dir &&
*x.out == *y.out &&
*x.name == *y.name &&
- (x.ext == nullptr || y.ext == nullptr || x.ext == y.ext);
+ (!x.ext || !y.ext || *x.ext == *y.ext);
}
inline bool