From: Jonathan Wakely Date: Tue, 18 Dec 2018 16:38:13 +0000 (+0000) Subject: Fix previous commit to move instead of copying X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fb601354e11d8c0db41cd119d51fe1acd4afa648;p=gcc.git Fix previous commit to move instead of copying * src/filesystem/std-dir.cc (filesystem::_Dir::advance): Move new path instead of copying. From-SVN: r267237 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index eefc953f5ca..5378bc38632 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2018-12-18 Jonathan Wakely + * 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. diff --git a/libstdc++-v3/src/filesystem/std-dir.cc b/libstdc++-v3/src/filesystem/std-dir.cc index 216182a2e56..b0f869fc8fd 100644 --- a/libstdc++-v3/src/filesystem/std-dir.cc +++ b/libstdc++-v3/src/filesystem/std-dir.cc @@ -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)