From 428ce65eebccc1992695f075e58b62598f771279 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 2 Aug 2016 09:36:34 +0200 Subject: Optimize out path::normalize() calls --- build2/search.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'build2/search.cxx') 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 ()) { -- cgit v1.1