aboutsummaryrefslogtreecommitdiff
path: root/build2/search.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-08-02 09:36:34 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-08-02 09:36:34 +0200
commit428ce65eebccc1992695f075e58b62598f771279 (patch)
tree054635c5c1d9d787f0f7db254d0ca3ec3825551e /build2/search.cxx
parent324ec39cafb1f12e7114e21391113f314ff70faf (diff)
Optimize out path::normalize() calls
Diffstat (limited to 'build2/search.cxx')
-rw-r--r--build2/search.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/build2/search.cxx b/build2/search.cxx
index 6d0a5e9..68191f5 100644
--- a/build2/search.cxx
+++ b/build2/search.cxx
@@ -107,8 +107,14 @@ namespace build2
// Check if there is a file.
//
const dir_path& s (pk.scope->src_path ());
- path f (s / *tk.dir / path (*tk.name));
- f.normalize ();
+
+ path f (s);
+ if (!tk.dir->empty ())
+ {
+ f /= *tk.dir;
+ f.normalize ();
+ }
+ f /= *tk.name;
if (!ext->empty ())
{