diff options
author | Lioncash <mathew1800@gmail.com> | 2019-04-05 15:11:12 -0400 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-04-05 15:12:20 -0400 |
commit | 28e36de56f6c04c7f3b9db0cf78d781093a819a1 (patch) | |
tree | 0f74117be95cbcadbc444040e1e090a957f958eb /src | |
parent | 66be5150d6d201e3f8ca6e5e09968f052df4beb1 (diff) |
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')
-rw-r--r-- | src/core/file_sys/fsmitm_romfsbuild.cpp | 4 |
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); |