From 8d9b0e75700d35a00066c6dad8670fa8e5a438a3 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 6 Feb 2020 01:25:25 +0000 Subject: In C++11 [io]fstream has std::string constructors; use them. --- src/fileutils.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/fileutils.cpp') diff --git a/src/fileutils.cpp b/src/fileutils.cpp index c99673d22..9f98d7a50 100644 --- a/src/fileutils.cpp +++ b/src/fileutils.cpp @@ -41,13 +41,11 @@ void FileReader::Load(const std::string& filename) } else { - const std::string realName = ServerInstance->Config->Paths.PrependConfig(filename); - lines.clear(); - - std::ifstream stream(realName.c_str()); + std::ifstream stream(ServerInstance->Config->Paths.PrependConfig(filename)); if (!stream.is_open()) throw CoreException(filename + " does not exist or is not readable!"); + lines.clear(); std::string line; while (std::getline(stream, line)) { -- cgit v1.3.1-10-gc9f91