Commit 601760a4 authored by Aaron's avatar Aaron
Browse files

safely handle empty input

parent 8c626811
...@@ -380,6 +380,9 @@ void ReportSummary(const vector<string> &group, const vector<vector<string> > &d ...@@ -380,6 +380,9 @@ void ReportSummary(const vector<string> &group, const vector<vector<string> > &d
vector<string> result; vector<string> result;
for( size_t i = 0; i < data.size(); i++ ) { for( size_t i = 0; i < data.size(); i++ ) {
if (data[i].size() == 0)
continue;
string op = ops[i]; string op = ops[i];
std::stringstream buffer; std::stringstream buffer;
VectorOps vo(data[i]); VectorOps vo(data[i]);
...@@ -442,10 +445,12 @@ void ReportSummary(const vector<string> &group, const vector<vector<string> > &d ...@@ -442,10 +445,12 @@ void ReportSummary(const vector<string> &group, const vector<vector<string> > &d
result.push_back(buffer.str()); result.push_back(buffer.str());
} }
} }
if (result.size() > 0) {
for_each(group.begin(), group.end(), TabPrintPost); for_each(group.begin(), group.end(), TabPrintPost);
cout << *result.begin(); cout << *result.begin();
for_each(++result.begin(), result.end(), TabPrintPre); for_each(++result.begin(), result.end(), TabPrintPre);
cout << endl; //Gets rid of extraneous tab cout << endl; //Gets rid of extraneous tab
}
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment