Skip to content
Snippets Groups Projects
Commit 8cd3d9be authored by Lioncash's avatar Lioncash
Browse files

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.
parent 195b5460
No related branches found
No related tags found
No related merge requests found
......@@ -257,8 +257,8 @@ public:
return WriteArray(&object, 1);
}
std::size_t WriteString(const std::string& str) {
return WriteArray(str.c_str(), str.length());
std::size_t WriteString(std::string_view str) {
return WriteArray(str.data(), str.length());
}
bool IsOpen() const {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment