Fix previous commit to move instead of copying
authorJonathan Wakely <jwakely@redhat.com>
Tue, 18 Dec 2018 16:38:13 +0000 (16:38 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 18 Dec 2018 16:38:13 +0000 (16:38 +0000)
* src/filesystem/std-dir.cc (filesystem::_Dir::advance): Move new
path instead of copying.

From-SVN: r267237

libstdc++-v3/ChangeLog
libstdc++-v3/src/filesystem/std-dir.cc

index eefc953f5ca488d9582fab8f72cf95d4436d1cea..5378bc386323845e039b6dcec36c3f321cc11001 100644 (file)
@@ -1,5 +1,8 @@
 2018-12-18  Jonathan Wakely  <jwakely@redhat.com>
 
+       * src/filesystem/std-dir.cc (filesystem::_Dir::advance): Move new
+       path instead of copying.
+
        * src/filesystem/std-dir.cc (filesystem::_Dir::advance): Append
        string to lvalue to avoid creating temporary path.
 
index 216182a2e56c906e3294e09ecb5c87050b36cd57..b0f869fc8fdbc62691c187de8e3e985647da8a72 100644 (file)
@@ -63,7 +63,7 @@ struct fs::_Dir : _Dir_base
       {
        auto name = path;
        name /= entp->d_name;
-       entry = fs::directory_entry{name, get_file_type(*entp)};
+       entry = fs::directory_entry{std::move(name), get_file_type(*entp)};
        return true;
       }
     else if (!ec)