summaryrefslogtreecommitdiff
path: root/src/core/file_sys
diff options
context:
space:
mode:
authorGravatar Lioncash2019-04-05 15:11:12 -0400
committerGravatar Lioncash2019-04-05 15:12:20 -0400
commit28e36de56f6c04c7f3b9db0cf78d781093a819a1 (patch)
tree0f74117be95cbcadbc444040e1e090a957f958eb /src/core/file_sys
parentMerge pull request #2282 from bunnei/gpu-asynch-v2 (diff)
downloadyuzu-28e36de56f6c04c7f3b9db0cf78d781093a819a1.tar.gz
yuzu-28e36de56f6c04c7f3b9db0cf78d781093a819a1.tar.xz
yuzu-28e36de56f6c04c7f3b9db0cf78d781093a819a1.zip
file_sys/fsmitm_romfsbuild: Utilize a string_view in romfs_calc_path_hash()
The given string instance doesn't need to be copied entirely, we can just use a view instead.
Diffstat (limited to 'src/core/file_sys')
-rw-r--r--src/core/file_sys/fsmitm_romfsbuild.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/file_sys/fsmitm_romfsbuild.cpp b/src/core/file_sys/fsmitm_romfsbuild.cpp
index 47b7526c7..d126ae8dd 100644
--- a/src/core/file_sys/fsmitm_romfsbuild.cpp
+++ b/src/core/file_sys/fsmitm_romfsbuild.cpp
@@ -23,6 +23,7 @@
23 */ 23 */
24 24
25#include <cstring> 25#include <cstring>
26#include <string_view>
26#include "common/alignment.h" 27#include "common/alignment.h"
27#include "common/assert.h" 28#include "common/assert.h"
28#include "core/file_sys/fsmitm_romfsbuild.h" 29#include "core/file_sys/fsmitm_romfsbuild.h"
@@ -97,7 +98,8 @@ struct RomFSBuildFileContext {
97 VirtualFile source; 98 VirtualFile source;
98}; 99};
99 100
100static u32 romfs_calc_path_hash(u32 parent, std::string path, u32 start, std::size_t path_len) { 101static u32 romfs_calc_path_hash(u32 parent, std::string_view path, u32 start,
102 std::size_t path_len) {
101 u32 hash = parent ^ 123456789; 103 u32 hash = parent ^ 123456789;
102 for (u32 i = 0; i < path_len; i++) { 104 for (u32 i = 0; i < path_len; i++) {
103 hash = (hash >> 5) | (hash << 27); 105 hash = (hash >> 5) | (hash << 27);