summaryrefslogtreecommitdiff
path: root/linguistic
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-12 14:33:06 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-13 11:11:27 +0200
commit3817965ded6c7ed915e4f9599e18b3e8abdaca44 (patch)
treee112927919e8b7c9ce6c1e233ff6fce05f189784 /linguistic
parent8ad920befe1290c40ef762e8d7d9797b1924f5d2 (diff)
add SvStream::ReadLine(OStringBuffer... to reduce OString allocation
and use it where possible Change-Id: I3efc7a642f73661ce606c917c0323ba9948521c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134265 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'linguistic')
-rw-r--r--linguistic/source/dicimp.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx
index 59e88fd009e5..803445b4ef28 100644
--- a/linguistic/source/dicimp.cxx
+++ b/linguistic/source/dicimp.cxx
@@ -124,7 +124,7 @@ sal_Int16 ReadDicVersion( SvStream& rStream, LanguageType &nLng, bool &bNeg, OUS
!strcmp(pMagicHeader, pVerOOo7))
{
bool bSuccess;
- OString aLine;
+ OStringBuffer aLine;
nDicVersion = DIC_VERSION_7;
@@ -165,7 +165,7 @@ sal_Int16 ReadDicVersion( SvStream& rStream, LanguageType &nLng, bool &bNeg, OUS
EXTENSION_FOR_TITLE_TEXT;
}
- if (aLine.indexOf("---") != -1) // end of header
+ if (std::string_view(aLine).find("---") != std::string_view::npos) // end of header
break;
}
if (!bSuccess)
@@ -362,7 +362,7 @@ ErrCode DictionaryNeo::loadEntries(const OUString &rMainURL)
}
else if (DIC_VERSION_7 == nDicVersion)
{
- OString aLine;
+ OStringBuffer aLine;
// remaining lines - stock strings (a [==] b)
while (pStream->ReadLine(aLine))