Remove redundant step in experimental::filesystem::path construction
authorJonathan Wakely <jwakely@redhat.com>
Fri, 26 Apr 2019 15:58:47 +0000 (16:58 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 26 Apr 2019 15:58:47 +0000 (16:58 +0100)
* 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

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

index 78626838d4ff877ca9475582be8356abbfa09caf..0f679e3fd892cf5c990dfe824df46fa1c33580a5 100644 (file)
@@ -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
index ebd5072fc1ab7762e1e70a2bf1ca95a913845655..c7b22f295690fe24b45587b646af747964a312d4 100644 (file)
@@ -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);
       }