From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4B3AC385740B; Sat, 28 Aug 2021 12:07:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B3AC385740B From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/99876] std::filesystem::absolute is inefficient Date: Sat, 28 Aug 2021 12:07:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 10.1.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2021 12:07:12 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99876 --- Comment #3 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:07b990ee23e0c7a92d362dbb25fd5d57d95eb8be commit r12-3198-g07b990ee23e0c7a92d362dbb25fd5d57d95eb8be Author: Jonathan Wakely Date: Fri Aug 27 10:59:54 2021 +0100 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 libstdc++-v3/ChangeLog: PR libstdc++/99876 * src/c++17/fs_ops.cc (fs::absolute): Call non-throwing form, to avoid unnecessary current_path() call.=