summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-04-05 23:40:16 -0400
committerGitHub <noreply@github.com>2019-04-05 23:40:16 -0400
commit00207cc965f447a209c50e28cd24de545edc366e (patch)
tree7c8f4d0c081f309053ed6ae4b8f89f8c65d24d7b /src
parente86b26cd2b263f3d5d97352f87a31dc65bd3cead (diff)
parent28e36de56f6c04c7f3b9db0cf78d781093a819a1 (diff)
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 @@
*/
#include <cstring>
+#include <string_view>
#include "common/alignment.h"
#include "common/assert.h"
#include "core/file_sys/fsmitm_romfsbuild.h"
@@ -97,7 +98,8 @@ struct RomFSBuildFileContext {
VirtualFile source;
};
-static u32 romfs_calc_path_hash(u32 parent, std::string path, u32 start, std::size_t path_len) {
+static u32 romfs_calc_path_hash(u32 parent, std::string_view path, u32 start,
+ std::size_t path_len) {
u32 hash = parent ^ 123456789;
for (u32 i = 0; i < path_len; i++) {
hash = (hash >> 5) | (hash << 27);