Use string instead of stringstream

Most of the monitor was already using string for formatted printing.
This commit is contained in:
Esa Korhonen
2018-09-26 16:47:32 +03:00
parent 07e407945b
commit 05d18e81ae
3 changed files with 25 additions and 20 deletions

View File

@ -14,10 +14,12 @@
#include "gtid.hh"
#include <algorithm>
#include <sstream>
#include <inttypes.h>
#include <maxbase/assert.h>
#include <maxscale/utils.hh>
using std::string;
using maxscale::string_printf;
GtidList GtidList::from_string(const string& gtid_string)
{
@ -226,12 +228,12 @@ bool Gtid::eq(const Gtid& rhs) const
string Gtid::to_string() const
{
std::stringstream ss;
string rval;
if (m_server_id != SERVER_ID_UNKNOWN)
{
ss << m_domain << "-" << m_server_id << "-" << m_sequence;
rval += string_printf("%" PRIu32 "-%" PRIi64 "-%" PRIu64, m_domain, m_server_id, m_sequence);
}
return ss.str();
return rval;
}
Gtid GtidList::get_gtid(uint32_t domain) const