Simplify output line construction
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include <regex>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <getopt.h>
|
||||
#include <libscrequest.hpp>
|
||||
@@ -65,9 +64,8 @@ int main(int argc, char* argv[]) {
|
||||
std::vector<std::string> lines;
|
||||
for (std::sregex_iterator i = beg; i != end; ++i) {
|
||||
std::smatch match {*i};
|
||||
std::ostringstream oss;
|
||||
oss << match[1] << " [" << match[2] << "]\n";
|
||||
lines.insert(lines.begin(), oss.str());
|
||||
std::string line = std::string(match[1]) + " [" + std::string(match[2]) + "]\n";
|
||||
lines.insert(lines.begin(), line);
|
||||
if (!all) break;
|
||||
}
|
||||
for (const std::string& line : lines) {
|
||||
|
Reference in New Issue
Block a user