From d4f953f87af7b1354d6dfb8593424375fc9f18a2 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 18 Mar 2019 17:15:08 -0400 Subject: minor optimization --- tools/preproc/c_file.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/preproc/c_file.cpp b/tools/preproc/c_file.cpp index 3a026d0d2..b550a53fa 100644 --- a/tools/preproc/c_file.cpp +++ b/tools/preproc/c_file.cpp @@ -34,13 +34,11 @@ CFile::CFile(std::string filename) : m_filename(filename) { if (filename == "-") { - std::string s; + std::string s, b; while (!std::cin.eof()) { - std::string b; std::getline(std::cin, b); - b += "\n"; - s += b; + s += b + "\n"; } m_size = s.size(); m_buffer = new char[m_size + 1]; -- cgit v1.2.3