basic: Compare with keywords without creating temporary strings
Change-Id: Ie284bbe4759a31c48cde415a4e673efd4c789741
Reviewed-on: https://gerrit.libreoffice.org/37252
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
diff --git a/basic/source/comp/token.cxx b/basic/source/comp/token.cxx
index aea95ef..0fd91c4 100644
--- a/basic/source/comp/token.cxx
+++ b/basic/source/comp/token.cxx
@@ -573,11 +573,8 @@ OUString SbiTokenizer::GetKeywordCase( const OUString& sKeyword )
const TokenTable* tp = pTokTable;
for( short i = 0; i < nToken; i++, tp++ )
{
OUString sStr = OStringToOUString(tp->s, RTL_TEXTENCODING_ASCII_US);
if( sStr.equalsIgnoreAsciiCase(sKeyword) )
{
return sStr;
}
if( sKeyword.equalsIgnoreAsciiCaseAscii(tp->s) )
return OStringToOUString(tp->s, RTL_TEXTENCODING_ASCII_US);
}
return OUString();
}