summaryrefslogtreecommitdiff
path: root/src/core/crypto/key_manager.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2018-08-04 16:35:35 -0400
committerGravatar Lioncash2018-08-04 16:37:30 -0400
commitc1f76abfafc3723b3b216d7985ec18d895699afc (patch)
tree36f6ba4ab6c9dcc8be48ee5797688630543bb982 /src/core/crypto/key_manager.cpp
parentMerge pull request #849 from DarkLordZach/xci (diff)
downloadyuzu-c1f76abfafc3723b3b216d7985ec18d895699afc.tar.gz
yuzu-c1f76abfafc3723b3b216d7985ec18d895699afc.tar.xz
yuzu-c1f76abfafc3723b3b216d7985ec18d895699afc.zip
key_manager: Use regular std::string instead of std::string_view
The benefit of std::string_view comes from the idea of avoiding copies (essentially acting as a non-owning view), however if we're just going to copy into a local variable immediately, there's not much benefit gained here.
Diffstat (limited to 'src/core/crypto/key_manager.cpp')
-rw-r--r--src/core/crypto/key_manager.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp
index 678ac5752..45e7e8545 100644
--- a/src/core/crypto/key_manager.cpp
+++ b/src/core/crypto/key_manager.cpp
@@ -66,8 +66,7 @@ KeyManager::KeyManager() {
66 AttemptLoadKeyFile(yuzu_keys_dir, hactool_keys_dir, "title.keys", true); 66 AttemptLoadKeyFile(yuzu_keys_dir, hactool_keys_dir, "title.keys", true);
67} 67}
68 68
69void KeyManager::LoadFromFile(std::string_view filename_, bool is_title_keys) { 69void KeyManager::LoadFromFile(const std::string& filename, bool is_title_keys) {
70 const auto filename = std::string(filename_);
71 std::ifstream file(filename); 70 std::ifstream file(filename);
72 if (!file.is_open()) 71 if (!file.is_open())
73 return; 72 return;
@@ -107,11 +106,8 @@ void KeyManager::LoadFromFile(std::string_view filename_, bool is_title_keys) {
107 } 106 }
108} 107}
109 108
110void KeyManager::AttemptLoadKeyFile(std::string_view dir1_, std::string_view dir2_, 109void KeyManager::AttemptLoadKeyFile(const std::string& dir1, const std::string& dir2,
111 std::string_view filename_, bool title) { 110 const std::string& filename, bool title) {
112 const std::string dir1(dir1_);
113 const std::string dir2(dir2_);
114 const std::string filename(filename_);
115 if (FileUtil::Exists(dir1 + DIR_SEP + filename)) 111 if (FileUtil::Exists(dir1 + DIR_SEP + filename))
116 LoadFromFile(dir1 + DIR_SEP + filename, title); 112 LoadFromFile(dir1 + DIR_SEP + filename, title);
117 else if (FileUtil::Exists(dir2 + DIR_SEP + filename)) 113 else if (FileUtil::Exists(dir2 + DIR_SEP + filename))