mirror of
https://github.com/citra-emu/citra.git
synced 2024-12-24 04:40:05 +00:00
title_metadata: Take std::vector by const reference in Load()
This isn't modified in the implementation, so this can be a const reference to eliminate an unnecessary heap reallocation.
This commit is contained in:
parent
147073a5a0
commit
10a32c94b6
@ -33,7 +33,7 @@ Loader::ResultStatus TitleMetadata::Load(const std::string& file_path) {
|
||||
return result;
|
||||
}
|
||||
|
||||
Loader::ResultStatus TitleMetadata::Load(const std::vector<u8> file_data, std::size_t offset) {
|
||||
Loader::ResultStatus TitleMetadata::Load(const std::vector<u8>& file_data, std::size_t offset) {
|
||||
std::size_t total_size = static_cast<std::size_t>(file_data.size() - offset);
|
||||
if (total_size < sizeof(u32_be))
|
||||
return Loader::ResultStatus::Error;
|
||||
|
@ -85,7 +85,7 @@ public:
|
||||
#pragma pack(pop)
|
||||
|
||||
Loader::ResultStatus Load(const std::string& file_path);
|
||||
Loader::ResultStatus Load(const std::vector<u8> file_data, std::size_t offset = 0);
|
||||
Loader::ResultStatus Load(const std::vector<u8>& file_data, std::size_t offset = 0);
|
||||
Loader::ResultStatus Save(const std::string& file_path);
|
||||
|
||||
u64 GetTitleID() const;
|
||||
|
Loading…
Reference in New Issue
Block a user