diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2021-08-05 11:59:09 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2021-08-05 11:59:09 +0200 |
commit | 2d382487e63c742becdc1adb37b12818976926b8 (patch) | |
tree | 1614e88ed92cd6345be5e72df30da840239884a6 /libbuild2 | |
parent | ea57c514dc169afb3ece21ff2e4c1d2ab0c47d6a (diff) |
Avoid normalizing likely already normalized directories in search_existing()
Diffstat (limited to 'libbuild2')
-rw-r--r-- | libbuild2/algorithm.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libbuild2/algorithm.cxx b/libbuild2/algorithm.cxx index 54ddf78..52e0926 100644 --- a/libbuild2/algorithm.cxx +++ b/libbuild2/algorithm.cxx @@ -132,7 +132,14 @@ namespace build2 return nullptr; if (!n.dir.empty ()) - n.dir.normalize (false, true); // Current dir collapses to an empty one. + { + // More often than not a non-empty directory will already be normalized. + // + // Note that we collapse current dir to an empty one. + // + if (!n.dir.normalized () || n.dir.string () == ".") + n.dir.normalize (false, true); + } bool q (cn.qualified ()); |