mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-02 18:53:58 +01:00
Optimize MetaFileSystem::ReadEntireFile
This commit is contained in:
1 parent
f53546362f
commit
8e2b73b05f
2 files changed
+4
-2
No files matched your search
@@ -649,7 +649,7 @@ int SavedataParam::LoadSaveData(SceUtilitySavedataParam *param, const std::strin
|
||||
std::string filename = GetFileName(param);
|
||||
std::string filePath = dirPath + "/" + filename;
|
||||
s64 readSize;
|
||||
INFO_LOG(SCEUTILITY,"Loading file with size %u in %s",param->dataBufSize,filePath.c_str());
|
||||
INFO_LOG(SCEUTILITY, "Loading file with size %u in %s", param->dataBufSize, filePath.c_str());
|
||||
u8 *saveData = nullptr;
|
||||
int saveSize = -1;
|
||||
if (!ReadPSPFile(filePath, &saveData, saveSize, &readSize)) {
|
||||
|
||||
@@ -588,7 +588,9 @@ int MetaFileSystem::ReadEntireFile(const std::string &filename, std::vector<u8>
|
||||
if (handle < 0)
|
||||
return handle;
|
||||
|
||||
size_t dataSize = (size_t)GetFileInfo(filename).size;
|
||||
SeekFile(handle, 0, FILEMOVE_END);
|
||||
size_t dataSize = GetSeekPos(handle);
|
||||
SeekFile(handle, 0, FILEMOVE_BEGIN);
|
||||
data.resize(dataSize);
|
||||
|
||||
size_t result = ReadFile(handle, (u8 *)&data[0], dataSize);
|
||||
|
||||
Reference in new issue
Block a user