]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Remove redundant step in experimental::filesystem::path construction
authorJonathan Wakely <jwakely@redhat.com>
Fri, 14 Jun 2019 18:11:26 +0000 (19:11 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 14 Jun 2019 18:11:26 +0000 (19:11 +0100)
Backport from mainline
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.

From-SVN: r272305

libstdc++-v3/ChangeLog
libstdc++-v3/include/experimental/bits/fs_path.h

index 78694e69b1e87faf30e532bc29f9ba26947b1da5..1f503c40fe89cb49e6301db6c945d77a2893ece2 100644 (file)
@@ -1,3 +1,12 @@
+2019-06-14  Jonathan Wakely  <jwakely@redhat.com>
+
+       Backport from mainline
+       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.
+
 2019-06-14  Jonathan Wakely  <jwakely@redhat.com>
 
        Backport from mainline
index ff12b3ca0724ae7253d3be4c5725bf87d303d468..647fb4db2828253aa74796f437d060aef11ba7a4 100644 (file)
@@ -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);
       }