From 1928361085c10b659a4a2878ec2a4b54ef0c39b8 Mon Sep 17 00:00:00 2001 From: EssaBoy Date: Fri, 18 Oct 2024 23:56:57 +0200 Subject: [PATCH] Optimisation of the smart pointer in PSPLoader and ISOFileSystem --- Core/FileSystems/ISOFileSystem.h | 2 +- Core/PSPLoaders.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Core/FileSystems/ISOFileSystem.h b/Core/FileSystems/ISOFileSystem.h index 492fcf9b2b..a90469dcd1 100644 --- a/Core/FileSystems/ISOFileSystem.h +++ b/Core/FileSystems/ISOFileSystem.h @@ -106,7 +106,7 @@ private: // the filenames to "", to achieve this. class ISOBlockSystem : public IFileSystem { public: - ISOBlockSystem(std::shared_ptr isoFileSystem) : isoFileSystem_(isoFileSystem) {} + ISOBlockSystem(std::shared_ptr isoFileSystem) : isoFileSystem_(std::move(isoFileSystem)) {} void DoState(PointerWrap &p) override { // This is a bit iffy, as block device savestates already are iffy (loads/saves multiple times for multiple mounts..) diff --git a/Core/PSPLoaders.cpp b/Core/PSPLoaders.cpp index e115558167..c1e59d2f3b 100644 --- a/Core/PSPLoaders.cpp +++ b/Core/PSPLoaders.cpp @@ -92,9 +92,8 @@ void InitMemoryForGameISO(FileLoader *fileLoader) { if (!bd) return; - auto iso = std::make_shared(&pspFileSystem, bd); - fileSystem = iso; - blockSystem = std::make_shared(iso); + fileSystem = std::make_shared(&pspFileSystem, bd); + blockSystem = std::make_shared(fileSystem); } pspFileSystem.Mount("umd0:", blockSystem);