Kaydet (Commit) c9545816 authored tarafından Caolán McNamara's avatar Caolán McNamara

micro optimizations

üst 26c20675
...@@ -84,7 +84,7 @@ namespace io_acceptor ...@@ -84,7 +84,7 @@ namespace io_acceptor
g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt ); g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
// make it unique // make it unique
m_sDescription += OUString::createFromAscii( ",uniqueValue=" ); m_sDescription += OUString(RTL_CONSTASCII_USTRINGPARAM(",uniqueValue="));
m_sDescription += OUString::valueOf( m_sDescription += OUString::valueOf(
sal::static_int_cast<sal_Int64 >( sal::static_int_cast<sal_Int64 >(
reinterpret_cast< sal_IntPtr >(&m_pipe)), reinterpret_cast< sal_IntPtr >(&m_pipe)),
...@@ -167,7 +167,7 @@ namespace io_acceptor ...@@ -167,7 +167,7 @@ namespace io_acceptor
m_pipe = Pipe( m_sPipeName.pData , osl_Pipe_CREATE , osl::Security() ); m_pipe = Pipe( m_sPipeName.pData , osl_Pipe_CREATE , osl::Security() );
if( ! m_pipe.is() ) if( ! m_pipe.is() )
{ {
OUString error = OUString::createFromAscii( "io.acceptor: Couldn't setup pipe " ); OUString error = OUString(RTL_CONSTASCII_USTRINGPARAM("io.acceptor: Couldn't setup pipe "));
error += m_sPipeName; error += m_sPipeName;
throw ConnectionSetupException( error, Reference< XInterface > () ); throw ConnectionSetupException( error, Reference< XInterface > () );
} }
...@@ -182,7 +182,7 @@ namespace io_acceptor ...@@ -182,7 +182,7 @@ namespace io_acceptor
} }
if( ! pipe.is() ) if( ! pipe.is() )
{ {
OUString error = OUString::createFromAscii( "io.acceptor: pipe already closed" ); OUString error = OUString(RTL_CONSTASCII_USTRINGPARAM("io.acceptor: pipe already closed"));
error += m_sPipeName; error += m_sPipeName;
throw ConnectionSetupException( error, Reference< XInterface > () ); throw ConnectionSetupException( error, Reference< XInterface > () );
} }
...@@ -202,7 +202,7 @@ namespace io_acceptor ...@@ -202,7 +202,7 @@ namespace io_acceptor
} }
else else
{ {
OUString error = OUString::createFromAscii( "io.acceptor: Couldn't setup pipe " ); OUString error = OUString(RTL_CONSTASCII_USTRINGPARAM("io.acceptor: Couldn't setup pipe "));
error += m_sPipeName; error += m_sPipeName;
throw ConnectionSetupException( error, Reference< XInterface > ()); throw ConnectionSetupException( error, Reference< XInterface > ());
} }
......
...@@ -308,7 +308,7 @@ namespace io_acceptor ...@@ -308,7 +308,7 @@ namespace io_acceptor
if( !pNames ) if( !pNames )
{ {
static Sequence< OUString > seqNames(1); static Sequence< OUString > seqNames(1);
seqNames.getArray()[0] = OUString::createFromAscii( SERVICE_NAME ); seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICE_NAME));
pNames = &seqNames; pNames = &seqNames;
} }
} }
......
...@@ -119,11 +119,11 @@ namespace stoc_connector ...@@ -119,11 +119,11 @@ namespace stoc_connector
} }
else else
{ {
OUString sMessage = OUString::createFromAscii( "Connector : couldn't connect to pipe " ); OUString sMessage = OUString(RTL_CONSTASCII_USTRINGPARAM("Connector : couldn't connect to pipe "));
sMessage += aName; sMessage += aName;
sMessage += OUString::createFromAscii( "(" ); sMessage += OUString(RTL_CONSTASCII_USTRINGPARAM("("));
sMessage += OUString::valueOf( (sal_Int32 ) pConn->m_pipe.getError() ); sMessage += OUString::valueOf( (sal_Int32 ) pConn->m_pipe.getError() );
sMessage += OUString::createFromAscii( ")" ); sMessage += OUString(RTL_CONSTASCII_USTRINGPARAM(")"));
delete pConn; delete pConn;
throw NoConnectException( sMessage ,Reference< XInterface > () ); throw NoConnectException( sMessage ,Reference< XInterface > () );
} }
...@@ -153,10 +153,10 @@ namespace stoc_connector ...@@ -153,10 +153,10 @@ namespace stoc_connector
SocketAddr AddrTarget( aHost.pData, nPort ); SocketAddr AddrTarget( aHost.pData, nPort );
if(pConn->m_socket.connect(AddrTarget) != osl_Socket_Ok) if(pConn->m_socket.connect(AddrTarget) != osl_Socket_Ok)
{ {
OUString sMessage = OUString::createFromAscii( "Connector : couldn't connect to socket (" ); OUString sMessage = OUString(RTL_CONSTASCII_USTRINGPARAM("Connector : couldn't connect to socket ("));
OUString sError = pConn->m_socket.getErrorAsString(); OUString sError = pConn->m_socket.getErrorAsString();
sMessage += sError; sMessage += sError;
sMessage += OUString::createFromAscii( ")" ); sMessage += OUString(RTL_CONSTASCII_USTRINGPARAM(")"));
delete pConn; delete pConn;
throw NoConnectException( sMessage, Reference < XInterface > () ); throw NoConnectException( sMessage, Reference < XInterface > () );
} }
...@@ -211,7 +211,7 @@ namespace stoc_connector ...@@ -211,7 +211,7 @@ namespace stoc_connector
if( !pNames ) if( !pNames )
{ {
static Sequence< OUString > seqNames(1); static Sequence< OUString > seqNames(1);
seqNames.getArray()[0] = OUString::createFromAscii( SERVICE_NAME ); seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICE_NAME));
pNames = &seqNames; pNames = &seqNames;
} }
} }
......
...@@ -46,7 +46,7 @@ namespace stoc_connector { ...@@ -46,7 +46,7 @@ namespace stoc_connector {
{ {
g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt ); g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
// make it unique // make it unique
m_sDescription += OUString::createFromAscii( ",uniqueValue=" ); m_sDescription += OUString(RTL_CONSTASCII_USTRINGPARAM(",uniqueValue="));
m_sDescription += OUString::valueOf( m_sDescription += OUString::valueOf(
sal::static_int_cast< sal_Int64 >( sal::static_int_cast< sal_Int64 >(
reinterpret_cast< sal_IntPtr >(&m_pipe)), reinterpret_cast< sal_IntPtr >(&m_pipe)),
......
...@@ -730,7 +730,7 @@ void OMarkableInputStream::skipBytes(sal_Int32 nBytesToSkip) ...@@ -730,7 +730,7 @@ void OMarkableInputStream::skipBytes(sal_Int32 nBytesToSkip)
{ {
if ( nBytesToSkip < 0 ) if ( nBytesToSkip < 0 )
throw BufferSizeExceededException( throw BufferSizeExceededException(
::rtl::OUString::createFromAscii( "precondition not met: XInputStream::skipBytes: non-negative integer required!" ), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("precondition not met: XInputStream::skipBytes: non-negative integer required!")),
*this *this
); );
......
...@@ -280,7 +280,7 @@ void Pump::run() ...@@ -280,7 +280,7 @@ void Pump::run()
if( ! rInput.is() ) if( ! rInput.is() )
{ {
NotConnectedException exception( NotConnectedException exception(
OUString::createFromAscii( "no input stream set" ) , Reference<XInterface>((OWeakObject*)this) ); OUString(RTL_CONSTASCII_USTRINGPARAM("no input stream set")) , Reference<XInterface>((OWeakObject*)this) );
throw exception; throw exception;
} }
Sequence< sal_Int8 > aData; Sequence< sal_Int8 > aData;
...@@ -289,7 +289,7 @@ void Pump::run() ...@@ -289,7 +289,7 @@ void Pump::run()
if( ! rOutput.is() ) if( ! rOutput.is() )
{ {
NotConnectedException exception( NotConnectedException exception(
OUString::createFromAscii( "no output stream set" ) , Reference<XInterface>( (OWeakObject*)this) ); OUString(RTL_CONSTASCII_USTRINGPARAM("no output stream set")) , Reference<XInterface>( (OWeakObject*)this) );
throw exception; throw exception;
} }
rOutput->writeBytes( aData ); rOutput->writeBytes( aData );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment