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
g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
// make it unique
m_sDescription += OUString::createFromAscii( ",uniqueValue=" );
m_sDescription += OUString(RTL_CONSTASCII_USTRINGPARAM(",uniqueValue="));
m_sDescription += OUString::valueOf(
sal::static_int_cast<sal_Int64 >(
reinterpret_cast< sal_IntPtr >(&m_pipe)),
......@@ -167,7 +167,7 @@ namespace io_acceptor
m_pipe = Pipe( m_sPipeName.pData , osl_Pipe_CREATE , osl::Security() );
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;
throw ConnectionSetupException( error, Reference< XInterface > () );
}
......@@ -182,7 +182,7 @@ namespace io_acceptor
}
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;
throw ConnectionSetupException( error, Reference< XInterface > () );
}
......@@ -202,7 +202,7 @@ namespace io_acceptor
}
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;
throw ConnectionSetupException( error, Reference< XInterface > ());
}
......
......@@ -308,7 +308,7 @@ namespace io_acceptor
if( !pNames )
{
static Sequence< OUString > seqNames(1);
seqNames.getArray()[0] = OUString::createFromAscii( SERVICE_NAME );
seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICE_NAME));
pNames = &seqNames;
}
}
......
......@@ -119,11 +119,11 @@ namespace stoc_connector
}
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 += OUString::createFromAscii( "(" );
sMessage += OUString(RTL_CONSTASCII_USTRINGPARAM("("));
sMessage += OUString::valueOf( (sal_Int32 ) pConn->m_pipe.getError() );
sMessage += OUString::createFromAscii( ")" );
sMessage += OUString(RTL_CONSTASCII_USTRINGPARAM(")"));
delete pConn;
throw NoConnectException( sMessage ,Reference< XInterface > () );
}
......@@ -153,10 +153,10 @@ namespace stoc_connector
SocketAddr AddrTarget( aHost.pData, nPort );
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();
sMessage += sError;
sMessage += OUString::createFromAscii( ")" );
sMessage += OUString(RTL_CONSTASCII_USTRINGPARAM(")"));
delete pConn;
throw NoConnectException( sMessage, Reference < XInterface > () );
}
......@@ -211,7 +211,7 @@ namespace stoc_connector
if( !pNames )
{
static Sequence< OUString > seqNames(1);
seqNames.getArray()[0] = OUString::createFromAscii( SERVICE_NAME );
seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICE_NAME));
pNames = &seqNames;
}
}
......
......@@ -46,7 +46,7 @@ namespace stoc_connector {
{
g_moduleCount.modCnt.acquire( &g_moduleCount.modCnt );
// make it unique
m_sDescription += OUString::createFromAscii( ",uniqueValue=" );
m_sDescription += OUString(RTL_CONSTASCII_USTRINGPARAM(",uniqueValue="));
m_sDescription += OUString::valueOf(
sal::static_int_cast< sal_Int64 >(
reinterpret_cast< sal_IntPtr >(&m_pipe)),
......
......@@ -730,7 +730,7 @@ void OMarkableInputStream::skipBytes(sal_Int32 nBytesToSkip)
{
if ( nBytesToSkip < 0 )
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
);
......
......@@ -280,7 +280,7 @@ void Pump::run()
if( ! rInput.is() )
{
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;
}
Sequence< sal_Int8 > aData;
......@@ -289,7 +289,7 @@ void Pump::run()
if( ! rOutput.is() )
{
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;
}
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