[nostalgia/tools/pack] Remove unnecessary copies and conversions

This commit is contained in:
Gary Talent 2021-04-17 17:35:57 -05:00
parent 28dc5552d4
commit c007b5b874

View File

@ -35,10 +35,10 @@ static ox::Error toMetalClaw(ox::Vector<uint8_t> *buff) noexcept {
// claw file transformations are broken out because path to inode // claw file transformations are broken out because path to inode
// transformations need to be done after the copy to the new FS is complete // transformations need to be done after the copy to the new FS is complete
static ox::Error transformClaw(ox::FileSystem *dest, ox::String path) noexcept { static ox::Error transformClaw(ox::FileSystem *dest, const ox::String &path) noexcept {
// copy // copy
oxTrace("pack::transformClaw") << "path:" << path.c_str(); oxTracef("pack::transformClaw", "path: {}", path);
oxRequire(fileList, dest->ls(path.c_str())); oxRequire(fileList, dest->ls(path));
for (auto i = 0u; i < fileList.size(); ++i) { for (auto i = 0u; i < fileList.size(); ++i) {
auto &name = fileList[i]; auto &name = fileList[i];
auto filePath = path + name; auto filePath = path + name;
@ -75,11 +75,11 @@ struct VerificationPair {
ox::Vector<uint8_t> buff; ox::Vector<uint8_t> buff;
}; };
static ox::Error copy(ox::FileSystem *src, ox::FileSystem *dest, ox::String path) noexcept { static ox::Error copy(ox::FileSystem *src, ox::FileSystem *dest, const ox::String &path) noexcept {
oxOutf("copying directory: {}\n", path); oxOutf("copying directory: {}\n", path);
ox::Vector<VerificationPair> verificationPairs; ox::Vector<VerificationPair> verificationPairs;
// copy // copy
oxRequire(fileList, src->ls(path.c_str())); oxRequire(fileList, src->ls(path));
for (auto i = 0u; i < fileList.size(); ++i) { for (auto i = 0u; i < fileList.size(); ++i) {
auto &name = fileList[i]; auto &name = fileList[i];
auto currentFile = path + name; auto currentFile = path + name;