diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-23 11:12:47 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-23 11:12:47 +0200 |
commit | 19c37866524f60a7710b256dd13bf1da9f8cff16 (patch) | |
tree | f396b93ac6c7f8d9b73d9ebec5cb6a9334bacee3 /build2/target | |
parent | 8c5688d77555091615dccd90ea1cf28b89c08d13 (diff) |
Change target_key::ext from pointer to pointer to reference to pointer
Probably can also do for the rest of the target_key members.
Diffstat (limited to 'build2/target')
-rw-r--r-- | build2/target | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/build2/target b/build2/target index 429df71..3d794c8 100644 --- a/build2/target +++ b/build2/target @@ -208,7 +208,7 @@ namespace build2 // to the targets's members will be reflected in the key. // target_key - key () const {return target_key {&type (), &dir, &name, &ext};} + key () const {return target_key {&type (), &dir, &name, ext};} // Scoping. // @@ -748,6 +748,8 @@ namespace build2 // struct target_set { + // @@ When we update ext in key, don't we change it? I think we do. + // typedef std::map<target_key, std::unique_ptr<target>> map; typedef butl::map_iterator_adapter<map::const_iterator> iterator; @@ -761,7 +763,7 @@ namespace build2 const std::string* ext, tracer& trace) const { - return find (target_key {&type, &dir, &name, &ext}, trace); + return find (target_key {&type, &dir, &name, ext}, trace); } // As above but ignore the extension and return the target or @@ -771,8 +773,7 @@ namespace build2 T* find (const dir_path& dir, const std::string& name) const { - const std::string* e (nullptr); - auto i (map_.find (target_key {&T::static_type, &dir, &name, &e})); + auto i (map_.find (target_key {&T::static_type, &dir, &name, nullptr})); return i != map_.end () ? static_cast<T*> (i->second.get ()) : nullptr; } |