summaryrefslogtreecommitdiff
path: root/io
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-04-29 12:24:31 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-04-29 18:25:31 +0200
commit04aafba860f613c20e7078d038cc83eb02de0b54 (patch)
tree8153152b87089419bde17313d9ac7b9de6fcce32 /io
parent76c793d2acf66f46e9edcda43d2f4327e8374841 (diff)
loplugin:stringadd simplify some *StringBuffer operations
pulled from a larger patch which I created with a more permissive variant of this plugin Change-Id: I7abf1f3f09e84703b6e0e52fe9587dff691b2187 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114875 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'io')
-rw-r--r--io/source/acceptor/acc_socket.cxx17
-rw-r--r--io/source/connector/ctr_socket.cxx17
2 files changed, 10 insertions, 24 deletions
diff --git a/io/source/acceptor/acc_socket.cxx b/io/source/acceptor/acc_socket.cxx
index 96d777fd0d8b..50a6db4bc13a 100644
--- a/io/source/acceptor/acc_socket.cxx
+++ b/io/source/acceptor/acc_socket.cxx
@@ -146,18 +146,11 @@ namespace io_acceptor {
void SocketConnection::completeConnectionString()
{
- OUStringBuffer buf( 256 );
- buf.append( ",peerPort=" );
- buf.append( m_socket.getPeerPort() );
- buf.append( ",peerHost=" );
- buf.append( m_socket.getPeerHost( ) );
-
- buf.append( ",localPort=" );
- buf.append( m_socket.getLocalPort() );
- buf.append( ",localHost=" );
- buf.append( m_socket.getLocalHost() );
-
- m_sDescription += buf;
+ m_sDescription +=
+ ",peerPort=" + OUString::number(m_socket.getPeerPort()) +
+ ",peerHost=" + m_socket.getPeerHost( ) +
+ ",localPort=" + OUString::number( m_socket.getLocalPort() ) +
+ ",localHost=" + m_socket.getLocalHost();
}
sal_Int32 SocketConnection::read( Sequence < sal_Int8 > & aReadBytes , sal_Int32 nBytesToRead )
diff --git a/io/source/connector/ctr_socket.cxx b/io/source/connector/ctr_socket.cxx
index 164cd4f6f31c..98b4131be407 100644
--- a/io/source/connector/ctr_socket.cxx
+++ b/io/source/connector/ctr_socket.cxx
@@ -105,18 +105,11 @@ namespace stoc_connector {
nPort = m_socket.getPeerPort();
- OUStringBuffer buf( 256 );
- buf.append( ",peerPort=" );
- buf.append( nPort );
- buf.append( ",peerHost=" );
- buf.append( m_socket.getPeerHost() );
-
- buf.append( ",localPort=" );
- buf.append( nPort );
- buf.append( ",localHost=" );
- buf.append( m_socket.getLocalHost( ) );
-
- m_sDescription += buf;
+ m_sDescription +=
+ ",peerPort=" + OUString::number( nPort ) +
+ ",peerHost=" + m_socket.getPeerHost() +
+ ",localPort=" + OUString::number( nPort ) +
+ ",localHost=" + m_socket.getLocalHost( );
}
sal_Int32 SocketConnection::read( Sequence < sal_Int8 > & aReadBytes , sal_Int32 nBytesToRead )