summaryrefslogtreecommitdiff
path: root/cppu
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2024-05-01 20:07:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-05-02 02:51:23 +0200
commite8fdc8a4ff60a392f51326e90212fc73d515e270 (patch)
treeaf45b4f9e96435d688a2b8c39a59ec7079381cda /cppu
parente8d1eec3e5cf08ca7de692f7d212b831db66ab96 (diff)
elide some OUString temporaries
Change-Id: I8364489639c8c02e9670ee597f48d61007244f5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166973 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cppu')
-rw-r--r--cppu/source/typelib/static_types.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/cppu/source/typelib/static_types.cxx b/cppu/source/typelib/static_types.cxx
index 67b63550e1cd..f91dbed71ddb 100644
--- a/cppu/source/typelib/static_types.cxx
+++ b/cppu/source/typelib/static_types.cxx
@@ -118,11 +118,11 @@ typelib_TypeDescriptionReference ** SAL_CALL typelib_static_type_getByTypeClass(
MutexGuard aGuard( typelib_StaticInitMutex() );
if (! s_aTypes[eTypeClass])
{
- static const char * s_aTypeNames[] = {
- "void", "char", "boolean", "byte",
- "short", "unsigned short", "long", "unsigned long",
- "hyper", "unsigned hyper", "float", "double",
- "string", "type", "any" };
+ static constexpr OUString s_aTypeNames[] = {
+ u"void"_ustr, u"char"_ustr, u"boolean"_ustr, u"byte"_ustr,
+ u"short"_ustr, u"unsigned short"_ustr, u"long"_ustr, u"unsigned long"_ustr,
+ u"hyper"_ustr, u"unsigned hyper"_ustr, u"float"_ustr, u"double"_ustr,
+ u"string"_ustr, u"type"_ustr, u"any"_ustr };
switch (eTypeClass)
{
@@ -258,7 +258,7 @@ typelib_TypeDescriptionReference ** SAL_CALL typelib_static_type_getByTypeClass(
}
default:
{
- OUString aTypeName( OUString::createFromAscii( s_aTypeNames[eTypeClass] ) );
+ OUString aTypeName( s_aTypeNames[eTypeClass] );
::typelib_typedescriptionreference_new( &s_aTypes[eTypeClass], eTypeClass, aTypeName.pData );
// another static ref:
++s_aTypes[eTypeClass]->nStaticRefCount;