From f5334930664b89fb3c68dd0b5f7d49d51dcce055 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 17 Jan 2011 10:42:03 +0000 Subject: equalsAsciiL faster than equalsAscii --- linguistic/source/convdic.cxx | 2 +- linguistic/source/convdiclist.cxx | 2 +- linguistic/source/convdicxml.cxx | 16 ++++++++-------- linguistic/source/hhconvdic.cxx | 4 ++-- linguistic/source/lngprophelp.cxx | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) (limited to 'linguistic') diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx index 434ed1b368c8..f0988a04b2ad 100644 --- a/linguistic/source/convdic.cxx +++ b/linguistic/source/convdic.cxx @@ -718,7 +718,7 @@ sal_Bool SAL_CALL ConvDic::supportsService( const OUString& rServiceName ) { MutexGuard aGuard( GetLinguMutex() ); sal_Bool bRes = sal_False; - if (rServiceName.equalsAscii( SN_CONV_DICTIONARY )) + if (rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(SN_CONV_DICTIONARY))) bRes = sal_True; return bRes; } diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index 3f17d8f43da5..4b97711cb24d 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.cxx @@ -661,7 +661,7 @@ sal_Bool SAL_CALL ConvDicList::supportsService( const OUString& rServiceName ) throw (RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); - return rServiceName.equalsAscii( SN_CONV_DICTIONARY_LIST ); + return rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(SN_CONV_DICTIONARY_LIST)); } diff --git a/linguistic/source/convdicxml.cxx b/linguistic/source/convdicxml.cxx index c0fb8f4d876b..dc16529d806e 100644 --- a/linguistic/source/convdicxml.cxx +++ b/linguistic/source/convdicxml.cxx @@ -224,7 +224,7 @@ SvXMLImportContext * ConvDicXMLImportContext::CreateChildContext( const uno::Reference< xml::sax::XAttributeList > & /*rxAttrList*/ ) { SvXMLImportContext *pContext = 0; - if (nPrefix == XML_NAMESPACE_TCD && rLocalName.equalsAscii( "text-conversion-dictionary" )) + if (nPrefix == XML_NAMESPACE_TCD && rLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("text-conversion-dictionary"))) pContext = new ConvDicXMLDictionaryContext_Impl( GetConvDicImport(), nPrefix, rLocalName ); else pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName ); @@ -245,9 +245,9 @@ void ConvDicXMLDictionaryContext_Impl::StartElement( GetKeyByAttrName( aAttrName, &aLocalName ); OUString aValue = rxAttrList->getValueByIndex(i); - if (nPrefix == XML_NAMESPACE_TCD && aLocalName.equalsAscii( "lang" )) + if (nPrefix == XML_NAMESPACE_TCD && aLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("lang"))) nLanguage = MsLangId::convertIsoStringToLanguage( aValue ); - else if (nPrefix == XML_NAMESPACE_TCD && aLocalName.equalsAscii( "conversion-type" )) + else if (nPrefix == XML_NAMESPACE_TCD && aLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("conversion-type"))) nConversionType = GetConversionTypeFromText( aValue ); } GetConvDicImport().SetLanguage( nLanguage ); @@ -264,7 +264,7 @@ SvXMLImportContext * ConvDicXMLDictionaryContext_Impl::CreateChildContext( const uno::Reference< xml::sax::XAttributeList > & /*rxAttrList*/ ) { SvXMLImportContext *pContext = 0; - if (nPrefix == XML_NAMESPACE_TCD && rLocalName.equalsAscii( "entry" )) + if (nPrefix == XML_NAMESPACE_TCD && rLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("entry"))) pContext = new ConvDicXMLEntryTextContext_Impl( GetConvDicImport(), nPrefix, rLocalName, *this ); else pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName ); @@ -278,7 +278,7 @@ SvXMLImportContext * ConvDicXMLEntryTextContext_Impl::CreateChildContext( const uno::Reference< xml::sax::XAttributeList > & /*rxAttrList*/ ) { SvXMLImportContext *pContext = 0; - if (nPrefix == XML_NAMESPACE_TCD && rLocalName.equalsAscii( "right-text" )) + if (nPrefix == XML_NAMESPACE_TCD && rLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("right-text"))) pContext = new ConvDicXMLRightTextContext_Impl( GetConvDicImport(), nPrefix, rLocalName, *this ); else pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName ); @@ -297,9 +297,9 @@ void ConvDicXMLEntryTextContext_Impl::StartElement( GetKeyByAttrName( aAttrName, &aLocalName ); OUString aValue = rxAttrList->getValueByIndex(i); - if (nPrefix == XML_NAMESPACE_TCD && aLocalName.equalsAscii( "left-text" )) + if (nPrefix == XML_NAMESPACE_TCD && aLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("left-text"))) aLeftText = aValue; - if (nPrefix == XML_NAMESPACE_TCD && aLocalName.equalsAscii( "property-type" )) + if (nPrefix == XML_NAMESPACE_TCD && aLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("property-type"))) nPropertyType = (sal_Int16) aValue.toInt32(); } } @@ -443,7 +443,7 @@ SvXMLImportContext * ConvDicXMLImport::CreateContext( const uno::Reference < xml::sax::XAttributeList > & /*rxAttrList*/ ) { SvXMLImportContext *pContext = 0; - if (nPrefix == XML_NAMESPACE_TCD && rLocalName.equalsAscii( "text-conversion-dictionary" )) + if (nPrefix == XML_NAMESPACE_TCD && rLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("text-conversion-dictionary"))) pContext = new ConvDicXMLDictionaryContext_Impl( *this, nPrefix, rLocalName ); else pContext = new SvXMLImportContext( *this, nPrefix, rLocalName ); diff --git a/linguistic/source/hhconvdic.cxx b/linguistic/source/hhconvdic.cxx index 43e4a0261e97..4954cae3a811 100644 --- a/linguistic/source/hhconvdic.cxx +++ b/linguistic/source/hhconvdic.cxx @@ -140,8 +140,8 @@ sal_Bool SAL_CALL HHConvDic::supportsService( const OUString& rServiceName ) { MutexGuard aGuard( GetLinguMutex() ); sal_Bool bRes = sal_False; - if (rServiceName.equalsAscii( SN_CONV_DICTIONARY )|| - rServiceName.equalsAscii( SN_HH_CONV_DICTIONARY )) + if (rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(SN_CONV_DICTIONARY)) || + rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(SN_HH_CONV_DICTIONARY))) bRes = sal_True; return bRes; } diff --git a/linguistic/source/lngprophelp.cxx b/linguistic/source/lngprophelp.cxx index 5f45aa595c1a..5f93135dc818 100644 --- a/linguistic/source/lngprophelp.cxx +++ b/linguistic/source/lngprophelp.cxx @@ -537,7 +537,7 @@ void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals ) const PropertyValue *pVal = rPropVals.getConstArray(); for (INT32 i = 0; i < nLen; ++i) { - if (pVal[i].Name.equalsAscii( UPN_MAX_NUMBER_OF_SUGGESTIONS )) + if (pVal[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(UPN_MAX_NUMBER_OF_SUGGESTIONS))) { pVal[i].Value >>= nResMaxNumberOfSuggestions; } -- cgit