diff options
| author | Lioncash <mathew1800@gmail.com> | 2016-09-14 19:41:38 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2016-09-14 19:41:41 -0400 |
| commit | 89c65be703c9ea5fc136b34f8d37286605dbc6d6 (patch) | |
| tree | 5c05f4cef99e87daccb40f613b5ac9b091ba36dc /Source/Core/DiscIO/NANDContentLoader.cpp | |
| parent | b1ffa740432f9322bf937101bbc3d0fe78876b62 (diff) | |
NANDContentLoader: Delay vector construction until needed in Get()
No need to construct the vector right off the bat.
Diffstat (limited to 'Source/Core/DiscIO/NANDContentLoader.cpp')
| -rw-r--r-- | Source/Core/DiscIO/NANDContentLoader.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/Core/DiscIO/NANDContentLoader.cpp b/Source/Core/DiscIO/NANDContentLoader.cpp index 6d4ec186c1..3f2c746bd6 100644 --- a/Source/Core/DiscIO/NANDContentLoader.cpp +++ b/Source/Core/DiscIO/NANDContentLoader.cpp @@ -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; |
