mirror of
https://git.h3cjp.net/H3cJP/yuzu.git
synced 2024-12-16 07:45:33 +00:00
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.
This commit is contained in:
parent
561d79e034
commit
93ac8d0fea
|
@ -90,7 +90,9 @@ VirtualFile PatchIPS(const VirtualFile& in, const VirtualFile& ips) {
|
||||||
|
|
||||||
if (temp != std::vector<u8>{'E', 'E', 'O', 'F'} && temp != std::vector<u8>{'E', 'O', 'F'})
|
if (temp != std::vector<u8>{'E', 'E', 'O', 'F'} && temp != std::vector<u8>{'E', 'O', 'F'})
|
||||||
return nullptr;
|
return nullptr;
|
||||||
return std::make_shared<VectorVfsFile>(in_data, in->GetName(), in->GetContainingDirectory());
|
|
||||||
|
return std::make_shared<VectorVfsFile>(std::move(in_data), in->GetName(),
|
||||||
|
in->GetContainingDirectory());
|
||||||
}
|
}
|
||||||
|
|
||||||
IPSwitchCompiler::IPSwitchCompiler(VirtualFile patch_text_) : patch_text(std::move(patch_text_)) {
|
IPSwitchCompiler::IPSwitchCompiler(VirtualFile patch_text_) : patch_text(std::move(patch_text_)) {
|
||||||
|
@ -291,7 +293,8 @@ VirtualFile IPSwitchCompiler::Apply(const VirtualFile& in) const {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::make_shared<VectorVfsFile>(in_data, in->GetName(), in->GetContainingDirectory());
|
return std::make_shared<VectorVfsFile>(std::move(in_data), in->GetName(),
|
||||||
|
in->GetContainingDirectory());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace FileSys
|
} // namespace FileSys
|
||||||
|
|
Loading…
Reference in a new issue