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
This commit is contained in:
Jonathan Wakely 2018-12-18 16:38:13 +00:00 committed by Jonathan Wakely
parent 8d53154813
commit fb601354e1
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2018-12-18 Jonathan Wakely <jwakely@redhat.com> 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 * src/filesystem/std-dir.cc (filesystem::_Dir::advance): Append
string to lvalue to avoid creating temporary path. string to lvalue to avoid creating temporary path.

View File

@ -63,7 +63,7 @@ struct fs::_Dir : _Dir_base
{ {
auto name = path; auto name = path;
name /= entp->d_name; 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; return true;
} }
else if (!ec) else if (!ec)