From 2cc0ef83cfd553b6d6e4d33d65c9aece133fa4ff Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 19 Jul 2018 10:30:50 -0400 Subject: filesystem: Remove pragma disabling global optimizations This was just an artifact missed during PR review. --- src/core/hle/service/filesystem/filesystem.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/core/hle') diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index ec528ef40..6d5ef2de4 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp @@ -2,8 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#pragma optimize("", off) - #include "common/assert.h" #include "common/file_util.h" #include "core/core.h" -- cgit v1.2.3 From abbf038191e834c47aba0d35c2468a159287f9ca Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 19 Jul 2018 10:32:21 -0400 Subject: filesystem: Use std::string's empty() function instead of comparing against a literal This is simply a basic value check as opposed to potentially doing string based operations (unlikely, but still, avoiding it is free). --- src/core/hle/service/filesystem/filesystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/hle') diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index 6d5ef2de4..a6b8386a7 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp @@ -23,7 +23,7 @@ constexpr u64 EMULATED_SD_REPORTED_SIZE = 32000000000; static FileSys::VirtualDir GetDirectoryRelativeWrapped(FileSys::VirtualDir base, const std::string& dir_name) { - if (dir_name == "." || dir_name == "" || dir_name == "/" || dir_name == "\\") + if (dir_name.empty() || dir_name == "." || dir_name == "/" || dir_name == "\\") return base; return base->GetDirectoryRelative(dir_name); -- cgit v1.2.3 From 5da4c78c6a1b6bef2ec3de49ef9688d548c376aa Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 19 Jul 2018 10:34:09 -0400 Subject: filesystem: std::move VirtualDir instance in VfsDirectoryServiceWrapper's constructor Avoids unnecessary atomic reference count incrementing and decrementing --- src/core/hle/service/filesystem/filesystem.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/core/hle') diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index a6b8386a7..55282f3af 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include + #include "common/assert.h" #include "common/file_util.h" #include "core/core.h" @@ -30,7 +32,7 @@ static FileSys::VirtualDir GetDirectoryRelativeWrapped(FileSys::VirtualDir base, } VfsDirectoryServiceWrapper::VfsDirectoryServiceWrapper(FileSys::VirtualDir backing_) - : backing(backing_) {} + : backing(std::move(backing_)) {} std::string VfsDirectoryServiceWrapper::GetName() const { return backing->GetName(); -- cgit v1.2.3