summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2018-07-20 22:23:56 -0400
committerGravatar Lioncash2018-07-20 22:23:58 -0400
commitd36e327ba62fc853d75c413fd30ba38385dfa210 (patch)
tree9c1c715eebdeda015d94722cea5a65a3d2192d54 /src
parentpartition_filesystem, vfs_real: Use std::distance() instead of subtraction (diff)
downloadyuzu-d36e327ba62fc853d75c413fd30ba38385dfa210.tar.gz
yuzu-d36e327ba62fc853d75c413fd30ba38385dfa210.tar.xz
yuzu-d36e327ba62fc853d75c413fd30ba38385dfa210.zip
partition_filesystem, vfs_real: Use std::move in ReplaceFileWithSubdirectory() where applicable
Avoids unnecessary atomic increment and decrement operations.
Diffstat (limited to 'src')
-rw-r--r--src/core/file_sys/partition_filesystem.cpp2
-rw-r--r--src/core/file_sys/vfs_real.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/core/file_sys/partition_filesystem.cpp b/src/core/file_sys/partition_filesystem.cpp
index fc37a40cc..c523a605a 100644
--- a/src/core/file_sys/partition_filesystem.cpp
+++ b/src/core/file_sys/partition_filesystem.cpp
@@ -109,7 +109,7 @@ bool PartitionFilesystem::ReplaceFileWithSubdirectory(VirtualFile file, VirtualD
109 pfs_files[offset] = pfs_files.back(); 109 pfs_files[offset] = pfs_files.back();
110 pfs_files.pop_back(); 110 pfs_files.pop_back();
111 111
112 pfs_dirs.emplace_back(dir); 112 pfs_dirs.emplace_back(std::move(dir));
113 113
114 return true; 114 return true;
115} 115}
diff --git a/src/core/file_sys/vfs_real.cpp b/src/core/file_sys/vfs_real.cpp
index fa0df1bbe..305d44a93 100644
--- a/src/core/file_sys/vfs_real.cpp
+++ b/src/core/file_sys/vfs_real.cpp
@@ -3,6 +3,7 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <iterator> 5#include <iterator>
6#include <utility>
6 7
7#include "common/common_paths.h" 8#include "common/common_paths.h"
8#include "common/logging/log.h" 9#include "common/logging/log.h"
@@ -173,7 +174,7 @@ bool RealVfsDirectory::ReplaceFileWithSubdirectory(VirtualFile file, VirtualDir
173 files[offset] = files.back(); 174 files[offset] = files.back();
174 files.pop_back(); 175 files.pop_back();
175 176
176 subdirectories.emplace_back(dir); 177 subdirectories.emplace_back(std::move(dir));
177 178
178 return true; 179 return true;
179} 180}