* src/filesystem/std-dir.cc (filesystem::_Dir::advance): Move new
path instead of copying.
From-SVN: r267237
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.
{
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)