mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-26 19:30:21 +00:00
Make TrimComment call TrimSpace
This commit is contained in:
parent
de75959fd7
commit
05f053007b
25
datatest.cpp
25
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;
|
||||
|
Loading…
Reference in New Issue
Block a user