i18nlangtag/source/languagetag/languagetag.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit bf2ae3c25a5da3a323c06fd5f949660ee64f0fa6 Author: Mike Kaganski <[email protected]> AuthorDate: Sat Feb 3 19:39:19 2024 +0600 Commit: Mike Kaganski <[email protected]> CommitDate: Sun Feb 4 03:39:42 2024 +0100 Use constexpr instead of const A local const static still needs a constructor the first time, and the short atomic checks if it is initialized every time the control flow crosses it. A constexpr static does not need all of that. Change-Id: I9c4cc082c7dfafcf6197dbe5a697ab27fdef2711 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162952 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx index 31de75b8fa65..26a3d5db2c79 100644 --- a/i18nlangtag/source/languagetag/languagetag.cxx +++ b/i18nlangtag/source/languagetag/languagetag.cxx @@ -1582,7 +1582,7 @@ const OUString & LanguageTagImpl::getBcp47() const const OUString & LanguageTag::getBcp47( bool bResolveSystem ) const { - static const OUString theEmptyBcp47 = u""_ustr; + static constexpr OUString theEmptyBcp47 = u""_ustr; if (!bResolveSystem && mbSystemLocale) return theEmptyBcp47;
