]> 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>
Tue, 12 Oct 2021 10:45:43 +0000 (11:45 +0100)
commit7df66a0c95a6b3678c73385969c1395a8aab2bd6
treeb64883a944cd672f7ab4fdd0840f60a99ae07bfc
parentaeee9251c64fe59c3e548e843f08bbda302cb08b
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.

(cherry picked from commit 07b990ee23e0c7a92d362dbb25fd5d57d95eb8be)
libstdc++-v3/src/c++17/fs_ops.cc