diff options
| author | 2018-10-09 13:34:38 -0400 | |
|---|---|---|
| committer | 2018-10-09 14:06:44 -0400 | |
| commit | 93ac8d0feadc129fdfdbaccd0c4e444b34ce2f15 (patch) | |
| tree | d7e1ae28eb1fca1538a78db89de350972d1ec111 /src/core | |
| parent | Merge pull request #1423 from DarkLordZach/romfs-file-exts (diff) | |
| download | yuzu-93ac8d0feadc129fdfdbaccd0c4e444b34ce2f15.tar.gz yuzu-93ac8d0feadc129fdfdbaccd0c4e444b34ce2f15.tar.xz yuzu-93ac8d0feadc129fdfdbaccd0c4e444b34ce2f15.zip | |
ips_layer: std::move data within PatchIPS() and Apply()
We don't need to make a copy of the read data, so we can std::move it
into the make_shared call here.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/file_sys/ips_layer.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/file_sys/ips_layer.cpp b/src/core/file_sys/ips_layer.cpp index 0cadbc375..b7a3df1b0 100644 --- a/src/core/file_sys/ips_layer.cpp +++ b/src/core/file_sys/ips_layer.cpp | |||
| @@ -90,7 +90,9 @@ VirtualFile PatchIPS(const VirtualFile& in, const VirtualFile& ips) { | |||
| 90 | 90 | ||
| 91 | if (temp != std::vector<u8>{'E', 'E', 'O', 'F'} && temp != std::vector<u8>{'E', 'O', 'F'}) | 91 | if (temp != std::vector<u8>{'E', 'E', 'O', 'F'} && temp != std::vector<u8>{'E', 'O', 'F'}) |
| 92 | return nullptr; | 92 | return nullptr; |
| 93 | return std::make_shared<VectorVfsFile>(in_data, in->GetName(), in->GetContainingDirectory()); | 93 | |
| 94 | return std::make_shared<VectorVfsFile>(std::move(in_data), in->GetName(), | ||
| 95 | in->GetContainingDirectory()); | ||
| 94 | } | 96 | } |
| 95 | 97 | ||
| 96 | IPSwitchCompiler::IPSwitchCompiler(VirtualFile patch_text_) : patch_text(std::move(patch_text_)) { | 98 | IPSwitchCompiler::IPSwitchCompiler(VirtualFile patch_text_) : patch_text(std::move(patch_text_)) { |
| @@ -291,7 +293,8 @@ VirtualFile IPSwitchCompiler::Apply(const VirtualFile& in) const { | |||
| 291 | } | 293 | } |
| 292 | } | 294 | } |
| 293 | 295 | ||
| 294 | return std::make_shared<VectorVfsFile>(in_data, in->GetName(), in->GetContainingDirectory()); | 296 | return std::make_shared<VectorVfsFile>(std::move(in_data), in->GetName(), |
| 297 | in->GetContainingDirectory()); | ||
| 295 | } | 298 | } |
| 296 | 299 | ||
| 297 | } // namespace FileSys | 300 | } // namespace FileSys |