summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
diff options
context:
space:
mode:
author npwoods <npwoods@mess.org>2022-06-11 08:24:49 -0400
committer GitHub <noreply@github.com>2022-06-11 14:24:49 +0200
commit7f0905bec30a608514bebee3aa13c1d9e75a3d0d (patch)
treef686f1867b3f4c63d6d751891e7365bf8879f326 /src/lib
parentf47f9c3db3c7d20bea0526425cdbc469d5a10868 (diff)
Changed the constructor of fs::dir_entry to take 'std::string &&name' instead of 'const std::string &name' (#9913)
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/formats/fs_oric_jasmin.cpp4
-rw-r--r--src/lib/formats/fs_prodos.cpp4
-rw-r--r--src/lib/formats/fs_vtech.cpp2
-rw-r--r--src/lib/formats/fsmgr.h2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/formats/fs_oric_jasmin.cpp b/src/lib/formats/fs_oric_jasmin.cpp
index 28c13ab634f..361f40332ea 100644
--- a/src/lib/formats/fs_oric_jasmin.cpp
+++ b/src/lib/formats/fs_oric_jasmin.cpp
@@ -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++;
}
diff --git a/src/lib/formats/fs_prodos.cpp b/src/lib/formats/fs_prodos.cpp
index df13d0a4caa..2ce67301999 100644
--- a/src/lib/formats/fs_prodos.cpp
+++ b/src/lib/formats/fs_prodos.cpp
@@ -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 ++;
}
diff --git a/src/lib/formats/fs_vtech.cpp b/src/lib/formats/fs_vtech.cpp
index e294e657801..7b8edf53f63 100644
--- a/src/lib/formats/fs_vtech.cpp
+++ b/src/lib/formats/fs_vtech.cpp
@@ -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++;
}
}
diff --git a/src/lib/formats/fsmgr.h b/src/lib/formats/fsmgr.h
index 9859f929e9d..201dfe389bb 100644
--- a/src/lib/formats/fsmgr.h
+++ b/src/lib/formats/fsmgr.h
@@ -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 {