mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 22:56:52 +01:00
NANDContentLoader: Delay vector construction until needed in Get()
No need to construct the vector right off the bat.
This commit is contained in:
parent
b1ffa74043
commit
89c65be703
@ -109,16 +109,16 @@ void CNANDContentDataFile::Open()
|
||||
}
|
||||
std::vector<u8> CNANDContentDataFile::Get()
|
||||
{
|
||||
std::vector<u8> result;
|
||||
EnsureOpen();
|
||||
|
||||
if (!m_file->IsGood())
|
||||
return result;
|
||||
return {};
|
||||
|
||||
u64 size = m_file->GetSize();
|
||||
if (size == 0)
|
||||
return result;
|
||||
return {};
|
||||
|
||||
result.resize(size);
|
||||
std::vector<u8> result(size);
|
||||
m_file->ReadBytes(result.data(), result.size());
|
||||
|
||||
return result;
|
||||
|
Loading…
x
Reference in New Issue
Block a user