mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-25 00:04:49 +02:00
Startup cleanup, part 1
This commit is contained in:
@@ -273,19 +273,19 @@ std::string MetaFileSystem::NormalizePrefix(std::string prefix) const {
|
||||
|
||||
void MetaFileSystem::Mount(const std::string &prefix, std::shared_ptr<IFileSystem> system) {
|
||||
std::lock_guard<std::recursive_mutex> guard(lock);
|
||||
|
||||
MountPoint x;
|
||||
x.prefix = prefix;
|
||||
x.system = system;
|
||||
for (auto &it : fileSystems) {
|
||||
if (it.prefix == prefix) {
|
||||
// Overwrite the old mount. Don't create a new one.
|
||||
it = x;
|
||||
// Overwrite the old mount.
|
||||
// shared_ptr makes sure there's no leak.
|
||||
it.system = system;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Prefix not yet mounted, do so.
|
||||
MountPoint x;
|
||||
x.prefix = prefix;
|
||||
x.system = system;
|
||||
fileSystems.push_back(x);
|
||||
}
|
||||
|
||||
@@ -305,17 +305,6 @@ void MetaFileSystem::Unmount(const std::string &prefix) {
|
||||
}
|
||||
}
|
||||
|
||||
bool MetaFileSystem::Remount(const std::string &prefix, std::shared_ptr<IFileSystem> system) {
|
||||
std::lock_guard<std::recursive_mutex> guard(lock);
|
||||
for (auto &it : fileSystems) {
|
||||
if (it.prefix == prefix) {
|
||||
it.system = system;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
IFileSystem *MetaFileSystem::GetSystemFromFilename(const std::string &filename) {
|
||||
size_t prefixPos = filename.find(':');
|
||||
if (prefixPos == filename.npos)
|
||||
|
||||
Reference in New Issue
Block a user