aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-01-13 20:35:14 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-01-13 20:39:10 +0300
commitb1f20ff41df80cd49aaa2670dede30ec8566fd26 (patch)
treedcb2da94885563d127df429f3432c84d41835900
parentd651a19f34fe53c8a479a0bbd1ccb77e1fcf7699 (diff)
Get rid of ostringstream in manifest parser code
-rw-r--r--libbutl/manifest-parser.cxx20
1 files 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 <libbutl/manifest-parser.hxx>
+#include <string>
#include <cassert>
-#include <sstream>
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::