package/source/zipapi/ZipFile.cxx |    1 +
 unotools/source/misc/fontdefs.cxx |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 8eabb8839dd81a1055aa0416ab5f3f67c7d3bb29
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri May 13 11:08:47 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat May 14 14:44:02 2022 +0200

    reserve space in map in ZipFile::readCEN
    
    Change-Id: I4d7764f00b7d05ba5d43a3fb35596f5ec4653da3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134302
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/package/source/zipapi/ZipFile.cxx 
b/package/source/zipapi/ZipFile.cxx
index 98f60bd4ab1d..aff8cce8fd34 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -918,6 +918,7 @@ sal_Int32 ZipFile::readCEN()
         ZipEntry aEntry;
         sal_Int16 nCommentLen;
 
+        aEntries.reserve(nTotal);
         for (nCount = 0 ; nCount < nTotal; nCount++)
         {
             sal_Int32 nTestSig = aMemGrabber.ReadInt32();
commit 832c17278c9497de4b4b4a461cf858e8a62420da
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri May 13 12:11:53 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat May 14 14:43:50 2022 +0200

    cache some OUString in GetEnglishSearchFontName
    
    rather than allocating them repeatedly
    
    Change-Id: Ie0f751f589b512a97534d193e1401312ae2f2afe
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134310
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/unotools/source/misc/fontdefs.cxx 
b/unotools/source/misc/fontdefs.cxx
index 5a9157d4fb12..568110315f33 100644
--- a/unotools/source/misc/fontdefs.cxx
+++ b/unotools/source/misc/fontdefs.cxx
@@ -291,7 +291,7 @@ OUString GetEnglishSearchFontName(std::u16string_view 
rInName)
     // translate normalized localized name to its normalized English ASCII name
     if( bNeedTranslation )
     {
-        typedef std::unordered_map<OUString, const char*> FontNameDictionary;
+        typedef std::unordered_map<OUString, OUString> FontNameDictionary;
         static FontNameDictionary const aDictionary = {
             {aBatang, "batang"},
             {aBatangChe, "batangche"},
@@ -452,7 +452,7 @@ OUString GetEnglishSearchFontName(std::u16string_view 
rInName)
 
         FontNameDictionary::const_iterator it = aDictionary.find( rNameStr );
         if( it != aDictionary.end() )
-            rNameStr = OUString::createFromAscii ( it->second );
+            rNameStr = it->second;
     }
 
     return rNameStr;

Reply via email to