diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-26 10:48:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-26 15:47:02 +0200 |
commit | 8d2a340eb8a4b6f51e2a121caba3a0d3b47504f2 (patch) | |
tree | c46ee63231500d2f05438799cd3a3a95d69b269d /unotools | |
parent | 73bada774ef37efd5a4498ccc083b1358314557d (diff) |
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/misc/fontdefs.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
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 <o3tl/safeint.hxx> +#include <o3tl/string_view.hxx> #include <unotools/fontdefs.hxx> #include <unotools/fontcfg.hxx> #include <rtl/ustrbuf.hxx> @@ -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: */ |