]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Fix inefficiency in filesystem::absolute [PR99876]
authorJonathan Wakely <jwakely@redhat.com>
Fri, 27 Aug 2021 09:59:54 +0000 (10:59 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Sat, 28 Aug 2021 10:52:22 +0000 (11:52 +0100)
commit07b990ee23e0c7a92d362dbb25fd5d57d95eb8be
tree1fe12d17bfc1fce7e9d91aa7a6d16e8bb4eb8bc1
parent952095bb053cfef47b48cc4345d658b8d8829800
libstdc++: Fix inefficiency in filesystem::absolute [PR99876]

When the path is already absolute, the call to current_path() is
wasteful, because operator/ will ignore the left operand anyway.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/99876
* src/c++17/fs_ops.cc (fs::absolute): Call non-throwing form,
to avoid unnecessary current_path() call.
libstdc++-v3/src/c++17/fs_ops.cc