summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2019-05-23 13:32:49 -0400
committerGravatar Lioncash2019-05-23 13:35:31 -0400
commit8cd3d9be2646eda7177344045984f2baf9520ad3 (patch)
tree053bbcf48663e6086cc59a971dd91b72038fed8c /src
parentshader/decode/memory: Remove left in debug pragma (diff)
downloadyuzu-8cd3d9be2646eda7177344045984f2baf9520ad3.tar.gz
yuzu-8cd3d9be2646eda7177344045984f2baf9520ad3.tar.xz
yuzu-8cd3d9be2646eda7177344045984f2baf9520ad3.zip
common/file_util: Make IOFile's WriteString take a std::string_view
We don't need to force the usage of a std::string here, and can instead use a std::string_view, which allows writing out other forms of strings (e.g. C-style strings) without any unnecessary heap allocations.
Diffstat (limited to 'src')
-rw-r--r--src/common/file_util.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/file_util.h b/src/common/file_util.h
index 38cc7f059..cd5a0c5fc 100644
--- a/src/common/file_util.h
+++ b/src/common/file_util.h
@@ -257,8 +257,8 @@ public:
257 return WriteArray(&object, 1); 257 return WriteArray(&object, 1);
258 } 258 }
259 259
260 std::size_t WriteString(const std::string& str) { 260 std::size_t WriteString(std::string_view str) {
261 return WriteArray(str.c_str(), str.length()); 261 return WriteArray(str.data(), str.length());
262 } 262 }
263 263
264 bool IsOpen() const { 264 bool IsOpen() const {