From c007b5b874b463e48a619d1b4279010eab9f0926 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 17 Apr 2021 17:35:57 -0500 Subject: [PATCH] [nostalgia/tools/pack] Remove unnecessary copies and conversions --- src/nostalgia/tools/pack/pack.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nostalgia/tools/pack/pack.cpp b/src/nostalgia/tools/pack/pack.cpp index 2e9f8f4fd..13194a6d0 100644 --- a/src/nostalgia/tools/pack/pack.cpp +++ b/src/nostalgia/tools/pack/pack.cpp @@ -35,10 +35,10 @@ static ox::Error toMetalClaw(ox::Vector *buff) noexcept { // claw file transformations are broken out because path to inode // 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 - oxTrace("pack::transformClaw") << "path:" << path.c_str(); - oxRequire(fileList, dest->ls(path.c_str())); + oxTracef("pack::transformClaw", "path: {}", path); + oxRequire(fileList, dest->ls(path)); for (auto i = 0u; i < fileList.size(); ++i) { auto &name = fileList[i]; auto filePath = path + name; @@ -75,11 +75,11 @@ struct VerificationPair { ox::Vector 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); ox::Vector verificationPairs; // copy - oxRequire(fileList, src->ls(path.c_str())); + oxRequire(fileList, src->ls(path)); for (auto i = 0u; i < fileList.size(); ++i) { auto &name = fileList[i]; auto currentFile = path + name;