From 16af62ebdbf7aa31b53a21d51a12cbc0a6a30402 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 14 Jun 2019 19:11:26 +0100 Subject: [PATCH] Remove redundant step in experimental::filesystem::path construction Backport from mainline 2019-04-26 Jonathan Wakely * include/experimental/bits/fs_path.h (path::_S_convert_loc<_InputIterator>): Create const std::string to avoid redundant call to _S_convert_loc with non-const pointers. From-SVN: r272305 --- libstdc++-v3/ChangeLog | 9 +++++++++ libstdc++-v3/include/experimental/bits/fs_path.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 78694e69b1e8..1f503c40fe89 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2019-06-14 Jonathan Wakely + + Backport from mainline + 2019-04-26 Jonathan Wakely + + * include/experimental/bits/fs_path.h + (path::_S_convert_loc<_InputIterator>): Create const std::string to + avoid redundant call to _S_convert_loc with non-const pointers. + 2019-06-14 Jonathan Wakely Backport from mainline diff --git a/libstdc++-v3/include/experimental/bits/fs_path.h b/libstdc++-v3/include/experimental/bits/fs_path.h index ff12b3ca0724..647fb4db2828 100644 --- a/libstdc++-v3/include/experimental/bits/fs_path.h +++ b/libstdc++-v3/include/experimental/bits/fs_path.h @@ -485,7 +485,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 _S_convert_loc(_InputIterator __src, __null_terminated, const std::locale& __loc) { - std::string __s = _S_string_from_iter(__src); + const std::string __s = _S_string_from_iter(__src); return _S_convert_loc(__s.data(), __s.data() + __s.size(), __loc); } -- 2.47.2