cellSaveData/UNIX: Optimize IO (#10574)

This commit is contained in:
Eladash 2021-07-18 22:08:04 +03:00 committed by GitHub
parent 65b2a0d538
commit a5c3c7d2e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1951,9 +1951,13 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
if (auto file = pair.second.release())
{
auto&& fvec = static_cast<fs::container_stream<std::vector<uchar>>&>(*file);
#ifdef _WIN32
fs::pending_file f(new_path + vfs::escape(pair.first));
f.file.write(fvec.obj);
ensure(f.commit());
#else
ensure(fs::write_file(new_path + vfs::escape(pair.first), fs::rewrite, fvec.obj));
#endif
}
}