mirror of
https://github.com/holub/mame
synced 2025-04-18 22:49:58 +03:00
Changed the constructor of fs::dir_entry to take 'std::string &&name' instead of 'const std::string &name' (#9913)
This commit is contained in:
parent
f47f9c3db3
commit
7f0905bec3
@ -286,10 +286,10 @@ std::vector<dir_entry> impl::root_dir::contents()
|
||||
std::string fname = read_file_name(bdir.rodata()+off+3);
|
||||
bool system = ref == 0 && id == 0 && bdir.r32b(off+0xb) == 0x2e535953;
|
||||
if(system)
|
||||
res.emplace_back(dir_entry(fname, dir_entry_type::system_file, 0));
|
||||
res.emplace_back(dir_entry(std::move(fname), dir_entry_type::system_file, 0));
|
||||
|
||||
else if(m_fs.ref_valid(ref))
|
||||
res.emplace_back(dir_entry(fname, dir_entry_type::file, id));
|
||||
res.emplace_back(dir_entry(std::move(fname), dir_entry_type::file, id));
|
||||
|
||||
id++;
|
||||
}
|
||||
|
@ -351,9 +351,9 @@ std::vector<dir_entry> impl::root_dir::contents()
|
||||
auto name = blk.rstr(off+1, type & 0xf);
|
||||
type >>= 4;
|
||||
if(type == 0xd)
|
||||
res.emplace_back(dir_entry(name, dir_entry_type::dir, id));
|
||||
res.emplace_back(dir_entry(std::move(name), dir_entry_type::dir, id));
|
||||
else if(type != 0)
|
||||
res.emplace_back(dir_entry(name, dir_entry_type::file, id));
|
||||
res.emplace_back(dir_entry(std::move(name), dir_entry_type::file, id));
|
||||
off += 39;
|
||||
id ++;
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ std::vector<dir_entry> vtech_image::impl::root_dir::contents()
|
||||
if(bdir.r8(off+1) != ':')
|
||||
continue;
|
||||
std::string fname = trim_end_spaces(bdir.rstr(off+2, 8));
|
||||
res.emplace_back(dir_entry(fname, dir_entry_type::file, id));
|
||||
res.emplace_back(dir_entry(std::move(fname), dir_entry_type::file, id));
|
||||
id++;
|
||||
}
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ struct dir_entry {
|
||||
dir_entry_type m_type;
|
||||
u64 m_key;
|
||||
|
||||
dir_entry(const std::string &name, dir_entry_type type, u64 key) : m_name(name), m_type(type), m_key(key) {}
|
||||
dir_entry(std::string &&name, dir_entry_type type, u64 key) : m_name(std::move(name)), m_type(type), m_key(key) {}
|
||||
};
|
||||
|
||||
class fsblk_t {
|
||||
|
Loading…
Reference in New Issue
Block a user