diff --git a/datatest.cpp b/datatest.cpp index 5913e5d7..4d0d7988 100644 --- a/datatest.cpp +++ b/datatest.cpp @@ -51,18 +51,6 @@ public: static const TestData *s_currentTestData = NULLPTR; -std::string TrimComment(std::string str) -{ - if (str.empty()) return ""; - - std::string::size_type first = str.find("#"); - - if (first != std::string::npos) - return str.substr(0, first); - else - return str; -} - std::string TrimSpace(std::string str) { if (str.empty()) return ""; @@ -79,6 +67,18 @@ std::string TrimSpace(std::string str) return ""; } +std::string TrimComment(std::string str) +{ + if (str.empty()) return ""; + + std::string::size_type first = str.find("#"); + + if (first != std::string::npos) + return TrimSpace(str.substr(0, first)); + else + return TrimSpace(str); +} + static void OutputTestData(const TestData &v) { std::cerr << "\n"; @@ -865,7 +865,6 @@ bool GetField(std::istream &is, std::string &name, std::string &value) // Re-trim after parsing line = TrimComment(line); - line = TrimSpace(line); if (line.empty()) continue;