From 8d2a340eb8a4b6f51e2a121caba3a0d3b47504f2 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 26 Apr 2023 10:48:22 +0200 Subject: tdf#108757 avoid some OUString construction on a hot path Change-Id: I468bc9fac024dd9fa33286382264e2b84617481b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151040 Tested-by: Jenkins Reviewed-by: Noel Grandin --- unotools/source/misc/fontdefs.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'unotools') diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx index 3ec1226a289d..b1cca8fe6469 100644 --- a/unotools/source/misc/fontdefs.cxx +++ b/unotools/source/misc/fontdefs.cxx @@ -18,6 +18,7 @@ */ #include +#include #include #include #include @@ -509,11 +510,10 @@ std::u16string_view GetNextFontToken( std::u16string_view rTokenStr, sal_Int32& static bool ImplIsFontToken( std::u16string_view rName, std::u16string_view rToken ) { - OUString aTempName; sal_Int32 nIndex = 0; do { - aTempName = GetNextFontToken( rName, nIndex ); + std::u16string_view aTempName = GetNextFontToken( rName, nIndex ); if ( rToken == aTempName ) return true; } @@ -572,9 +572,9 @@ OUString GetSubsFontName( std::u16string_view rName, SubsFontFlags nFlags ) bool IsOpenSymbol(std::u16string_view rFontName) { sal_Int32 nIndex = 0; - OUString sFamilyNm(GetNextFontToken(rFontName, nIndex)); - return (sFamilyNm.equalsIgnoreAsciiCase("starsymbol") || - sFamilyNm.equalsIgnoreAsciiCase("opensymbol")); + std::u16string_view sFamilyNm(GetNextFontToken(rFontName, nIndex)); + return (o3tl::equalsIgnoreAsciiCase(sFamilyNm, "starsymbol") || + o3tl::equalsIgnoreAsciiCase(sFamilyNm, "opensymbol")); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit