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