mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 11:05:46 +00:00
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.
This commit is contained in:
parent
d9b4b49538
commit
e71ba6388a
1 changed files with 2 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue