From 19c37866524f60a7710b256dd13bf1da9f8cff16 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 23 Jan 2016 11:12:47 +0200 Subject: Change target_key::ext from pointer to pointer to reference to pointer Probably can also do for the rest of the target_key members. --- build2/target | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'build2/target') 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> map; typedef butl::map_iterator_adapter 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 (i->second.get ()) : nullptr; } -- cgit v1.1