Make TrimComment call TrimSpace

This commit is contained in:
Jeffrey Walton 2018-11-11 12:41:29 -05:00
parent de75959fd7
commit 05f053007b
No known key found for this signature in database
GPG Key ID: B36AB348921B1838

View File

@ -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;