diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2012-07-12 22:10:17 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2012-07-13 16:36:04 +0200 |
commit | a7674482254ee996b1c4fee60f3064778be369aa (patch) | |
tree | dcafebf4d72d6d26ad949f0d18a000ea00f02315 /sc/source | |
parent | 0cba5e5d25bf2f30c8500e1e673a7ef9e8e8d352 (diff) |
Search for char instead of 1 char long string, when possible.
It is faster and even avoid memory allocation somtimes.
Change-Id: Ic12ff70e95953de44ef5798131150669d07a5445
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/filter/xml/xmlcondformat.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/vba/vbafilesearch.cxx | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx index ed9bc497c48a..7878b827e6cb 100644 --- a/sc/source/filter/xml/xmlcondformat.cxx +++ b/sc/source/filter/xml/xmlcondformat.cxx @@ -343,17 +343,17 @@ void GetConditionData(const rtl::OUString& rValue, ScConditionMode& eMode, rtl:: rExpr1 = rValue.copy(2); eMode = SC_COND_NOTEQUAL; } - else if(rValue.indexOf("<") == 0) + else if(rValue.indexOf('<') == 0) { rExpr1 = rValue.copy(1); eMode = SC_COND_LESS; } - else if(rValue.indexOf("=") == 0) + else if(rValue.indexOf('=') == 0) { rExpr1 = rValue.copy(1); eMode = SC_COND_EQUAL; } - else if(rValue.indexOf(">") == 0) + else if(rValue.indexOf('>') == 0) { rExpr1 = rValue.copy(1); eMode = SC_COND_GREATER; diff --git a/sc/source/ui/vba/vbafilesearch.cxx b/sc/source/ui/vba/vbafilesearch.cxx index ddb5c04be3eb..c0c6f9761541 100644 --- a/sc/source/ui/vba/vbafilesearch.cxx +++ b/sc/source/ui/vba/vbafilesearch.cxx @@ -180,7 +180,7 @@ sal_Int32 SAL_CALL ScVbaFileSearch::Execute( ) throw (css::uno::RuntimeExceptio if ( IsWildCard( aTempFileName ) ) { bool bEndWithAsterisk = aTempFileName.endsWithAsciiL("*", 1); - bool bStartWithAsterisk = (aTempFileName.indexOf(::rtl::OUString("*")) == 0); + bool bStartWithAsterisk = (aTempFileName.indexOf('*') == 0); if ( !bEndWithAsterisk && !bStartWithAsterisk ) { aTempFileName = ::rtl::OUString("*") + aTempFileName + ::rtl::OUString("*"); |