diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2019-04-26 16:58:47 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2019-04-26 16:58:47 +0100 |
commit | 700e6332a7fed75fca4515e24263492ff7a83344 (patch) | |
tree | e4118c120add25cf88e7a040a1a29498c8713126 | |
parent | 224d9de0e84026e7c19c51f05d2f4e8dedd291ed (diff) | |
download | gcc-700e6332a7fed75fca4515e24263492ff7a83344.zip gcc-700e6332a7fed75fca4515e24263492ff7a83344.tar.gz gcc-700e6332a7fed75fca4515e24263492ff7a83344.tar.bz2 |
Remove redundant step in experimental::filesystem::path construction
* 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: r270608
-rw-r--r-- | libstdc++-v3/ChangeLog | 4 | ||||
-rw-r--r-- | libstdc++-v3/include/experimental/bits/fs_path.h | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 7862683..0f679e3 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,9 @@ 2019-04-26 Jonathan Wakely <jwakely@redhat.com> + * 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. + * testsuite/20_util/variant/run.cc: Use a new Hashable type to test hashing, because pmr::string depends on _GLIBCXX_USE_CXX11_ABI==1. * testsuite/21_strings/basic_string/hash/hash.cc diff --git a/libstdc++-v3/include/experimental/bits/fs_path.h b/libstdc++-v3/include/experimental/bits/fs_path.h index ebd5072..c7b22f2 100644 --- a/libstdc++-v3/include/experimental/bits/fs_path.h +++ b/libstdc++-v3/include/experimental/bits/fs_path.h @@ -483,7 +483,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); } |