Commit fb601354 by Jonathan Wakely Committed by Jonathan Wakely

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
parent 8d531548
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.
......
...@@ -63,7 +63,7 @@ struct fs::_Dir : _Dir_base ...@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment