summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2019-04-05 23:40:16 -0400
committerGravatar GitHub2019-04-05 23:40:16 -0400
commit00207cc965f447a209c50e28cd24de545edc366e (patch)
tree7c8f4d0c081f309053ed6ae4b8f89f8c65d24d7b /src
parentMerge pull request #2334 from lioncash/override (diff)
parentfile_sys/fsmitm_romfsbuild: Utilize a string_view in romfs_calc_path_hash() (diff)
downloadyuzu-00207cc965f447a209c50e28cd24de545edc366e.tar.gz
yuzu-00207cc965f447a209c50e28cd24de545edc366e.tar.xz
yuzu-00207cc965f447a209c50e28cd24de545edc366e.zip
Merge pull request #2340 from lioncash/view
file_sys/fsmitm_romfsbuild: Utilize a string_view in romfs_calc_path_hash
Diffstat (limited to 'src')
-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);