diff options
author | Noel Grandin <noel@peralex.com> | 2013-11-05 14:39:55 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-11-11 12:58:13 +0200 |
commit | fcd1637d5101b9142e6808edfb77b01122857901 (patch) | |
tree | 5fd09f97de80cf2a9481bd55a798015db35f1d0c /connectivity/source/drivers | |
parent | ef90021abe3735fba57145598fd7c3d359d2718e (diff) |
convert OUString compareToAscii == 0 to equalsAscii
Convert code like
aStr.compareToAscii("XXX") == 0
to
aStr.equalsAscii("XXX")
which is both easier to read and faster.
Change-Id: I448abf58f2fa0e7715dba53f8e8825ca0587c83f
Diffstat (limited to 'connectivity/source/drivers')
-rw-r--r-- | connectivity/source/drivers/hsqldb/HConnection.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MDriver.cxx | 4 | ||||
-rw-r--r-- | connectivity/source/drivers/mork/MResultSet.cxx | 4 | ||||
-rw-r--r-- | connectivity/source/drivers/mozab/MDriver.cxx | 2 | ||||
-rw-r--r-- | connectivity/source/drivers/mozab/MResultSet.cxx | 4 |
5 files changed, 8 insertions, 8 deletions
diff --git a/connectivity/source/drivers/hsqldb/HConnection.cxx b/connectivity/source/drivers/hsqldb/HConnection.cxx index 6d4577c40256..40e9a8237fc3 100644 --- a/connectivity/source/drivers/hsqldb/HConnection.cxx +++ b/connectivity/source/drivers/hsqldb/HConnection.cxx @@ -173,7 +173,7 @@ namespace connectivity { namespace hsqldb const PropertyValue* pEnd = pIter + aInfo.getLength(); for(;pIter != pEnd;++pIter) { - if ( pIter->Name.compareToAscii("readonly") == 0 ) + if ( pIter->Name.equalsAscii("readonly") ) m_bReadOnly = true; } } diff --git a/connectivity/source/drivers/mork/MDriver.cxx b/connectivity/source/drivers/mork/MDriver.cxx index 1a70ed251048..851e18e9a902 100644 --- a/connectivity/source/drivers/mork/MDriver.cxx +++ b/connectivity/source/drivers/mork/MDriver.cxx @@ -118,8 +118,8 @@ sal_Bool MorkDriver::acceptsURL(OUString const & url) aAddrbookScheme = aAddrbookURI.copy(0, nLen); } - if ((aAddrbookScheme.compareToAscii( "thunderbird" ) == 0) || - (aAddrbookScheme.compareToAscii( "mozilla" ) == 0)) + if (aAddrbookScheme.equalsAscii( "thunderbird" ) || + aAddrbookScheme.equalsAscii( "mozilla" ) ) { return true; } diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx index 163054e46110..99f7275559a8 100644 --- a/connectivity/source/drivers/mork/MResultSet.cxx +++ b/connectivity/source/drivers/mork/MResultSet.cxx @@ -875,8 +875,8 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT matchString = parseTree->getChild(2)->getTokenValue(); } - if ( columnName.compareToAscii("0") ==0 && op == MQueryOp::Is && - matchString.compareToAscii("1") == 0 ) { + if ( columnName.equalsAscii("0") && op == MQueryOp::Is && + matchString.equalsAscii("1") ) { OSL_TRACE("Query always evaluates to FALSE"); m_bIsAlwaysFalseQuery = sal_True; } diff --git a/connectivity/source/drivers/mozab/MDriver.cxx b/connectivity/source/drivers/mozab/MDriver.cxx index 766d251468c9..8d789380a255 100644 --- a/connectivity/source/drivers/mozab/MDriver.cxx +++ b/connectivity/source/drivers/mozab/MDriver.cxx @@ -245,7 +245,7 @@ EDriverType MozabDriver::impl_classifyURL( const OUString& url ) for ( size_t i=0; i < sizeof( aSchemeMap ) / sizeof( aSchemeMap[0] ); ++i ) { - if ( aAddrbookScheme.compareToAscii( aSchemeMap[i].pScheme ) == 0 ) + if ( aAddrbookScheme.equalsAscii( aSchemeMap[i].pScheme ) ) return aSchemeMap[i].eType; } diff --git a/connectivity/source/drivers/mozab/MResultSet.cxx b/connectivity/source/drivers/mozab/MResultSet.cxx index 13ce879b32c2..d0e449e4be7a 100644 --- a/connectivity/source/drivers/mozab/MResultSet.cxx +++ b/connectivity/source/drivers/mozab/MResultSet.cxx @@ -857,8 +857,8 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT matchString = parseTree->getChild(2)->getTokenValue(); } - if ( columnName.compareToAscii("0") ==0 && op == MQueryOp::Is && - matchString.compareToAscii("1") == 0 ) { + if ( columnName.equalsAscii("0") && op == MQueryOp::Is && + matchString.equalsAscii("1") ) { OSL_TRACE("Query always evaluates to FALSE"); m_bIsAlwaysFalseQuery = sal_True; } |