diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-15 09:39:14 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-15 13:54:53 +0200 |
commit | 46ce0d28b4c765076c7871358375c4e85e44534b (patch) | |
tree | b17378d5258a51185001eac455a764897e6dda11 /ucb | |
parent | 00f7309fb786efcc0bbca04fb29de80f275a16ba (diff) |
loplugin:stringliteralvar look for assignments
to O[U]String from char array literals, we can convert the char literals
to O[U]StringLiteral and avoid a runtime allocation
Change-Id: I15d8dddb2cd428b90740e39f20daf98e0941aa6d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114125
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/webdav-neon/UCBDeadPropertyValue.cxx | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/ucb/source/ucp/webdav-neon/UCBDeadPropertyValue.cxx b/ucb/source/ucp/webdav-neon/UCBDeadPropertyValue.cxx index 497c700ec04a..967d1f36debe 100644 --- a/ucb/source/ucp/webdav-neon/UCBDeadPropertyValue.cxx +++ b/ucb/source/ucp/webdav-neon/UCBDeadPropertyValue.cxx @@ -49,19 +49,19 @@ struct UCBDeadPropertyValueParseContext } -const char aTypeString[] = "string"; -const char aTypeLong[] = "long"; -const char aTypeShort[] = "short"; -const char aTypeBoolean[] = "boolean"; -const char aTypeChar[] = "char"; -const char aTypeByte[] = "byte"; -const char aTypeHyper[] = "hyper"; -const char aTypeFloat[] = "float"; -const char aTypeDouble[] = "double"; - -const char aXMLPre[] = "<ucbprop><type>"; -const char aXMLMid[] = "</type><value>"; -const char aXMLEnd[] = "</value></ucbprop>"; +constexpr OUStringLiteral aTypeString = u"string"; +constexpr OUStringLiteral aTypeLong = u"long"; +constexpr OUStringLiteral aTypeShort = u"short"; +constexpr OUStringLiteral aTypeBoolean = u"boolean"; +constexpr OUStringLiteral aTypeChar = u"char"; +constexpr OUStringLiteral aTypeByte = u"byte"; +constexpr OUStringLiteral aTypeHyper = u"hyper"; +constexpr OUStringLiteral aTypeFloat = u"float"; +constexpr OUStringLiteral aTypeDouble = u"double"; + +constexpr OUStringLiteral aXMLPre = u"<ucbprop><type>"; +constexpr OUStringLiteral aXMLMid = u"</type><value>"; +constexpr OUStringLiteral aXMLEnd = u"</value></ucbprop>"; #define STATE_TOP (1) |