diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2019-03-18 17:15:08 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2019-03-18 17:15:08 -0400 |
commit | d4f953f87af7b1354d6dfb8593424375fc9f18a2 (patch) | |
tree | 52b0ab9535afe9fefe36371e2446ff84441ec6bf | |
parent | f29b9d30ea74275a4c9955393059af6bdc2d07a7 (diff) |
minor optimization
-rw-r--r-- | tools/preproc/c_file.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
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]; |