mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-02 14:19:02 +00:00
Merge pull request #6821 from lioncash/file
FileUtil: Remove unnecessary IOFile GetHandle() call in ReadFileToString()
This commit is contained in:
commit
85e3e6153b
1 changed files with 3 additions and 7 deletions
|
@ -883,16 +883,12 @@ bool WriteStringToFile(const std::string& str, const std::string& filename)
|
||||||
bool ReadFileToString(const std::string& filename, std::string& str)
|
bool ReadFileToString(const std::string& filename, std::string& str)
|
||||||
{
|
{
|
||||||
File::IOFile file(filename, "rb");
|
File::IOFile file(filename, "rb");
|
||||||
auto const f = file.GetHandle();
|
|
||||||
|
|
||||||
if (!f)
|
if (!file)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
size_t read_size;
|
str.resize(file.GetSize());
|
||||||
str.resize(GetSize(f));
|
return file.ReadArray(&str[0], str.size());
|
||||||
bool retval = file.ReadArray(&str[0], str.size(), &read_size);
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace File
|
} // namespace File
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue