diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2018-05-12 12:45:44 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-12 12:45:44 +0200 |
| commit | 85e3e6153b216c1868c7174ad1dca7360eef5127 (patch) | |
| tree | c9a35f90aa0898393a5ebe7af4c3f5ea34f32223 /Source/Core/Common/FileUtil.cpp | |
| parent | f0c5b761865946f273b6b6937aa47f8b10c745a5 (diff) | |
| parent | a85aa73c4d5e7b37856912925bf5dc9a8bcb38b4 (diff) | |
Merge pull request #6821 from lioncash/file
FileUtil: Remove unnecessary IOFile GetHandle() call in ReadFileToString()
Diffstat (limited to 'Source/Core/Common/FileUtil.cpp')
| -rw-r--r-- | Source/Core/Common/FileUtil.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index 66f1decdc5..3b8ea2a84e 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -883,16 +883,12 @@ bool WriteStringToFile(const std::string& str, const std::string& filename) bool ReadFileToString(const std::string& filename, std::string& str) { File::IOFile file(filename, "rb"); - auto const f = file.GetHandle(); - if (!f) + if (!file) return false; - size_t read_size; - str.resize(GetSize(f)); - bool retval = file.ReadArray(&str[0], str.size(), &read_size); - - return retval; + str.resize(file.GetSize()); + return file.ReadArray(&str[0], str.size()); } } // namespace File |
