From b1f20ff41df80cd49aaa2670dede30ec8566fd26 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 13 Jan 2022 20:35:14 +0300 Subject: Get rid of ostringstream in manifest parser code --- libbutl/manifest-parser.cxx | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/libbutl/manifest-parser.cxx b/libbutl/manifest-parser.cxx index ae0d43d..258a536 100644 --- a/libbutl/manifest-parser.cxx +++ b/libbutl/manifest-parser.cxx @@ -3,8 +3,8 @@ #include +#include #include -#include using namespace std; @@ -479,11 +479,21 @@ namespace butl static inline string format (const string& n, uint64_t l, uint64_t c, const string& d) { - ostringstream os; + using std::to_string; + + string r; if (!n.empty ()) - os << n << ':'; - os << l << ':' << c << ": error: " << d; - return os.str (); + { + r += n; + r += ':'; + } + + r += to_string (l); + r += ':'; + r += to_string (c); + r += ": error: "; + r += d; + return r; } manifest_parsing:: -- cgit v1.1