summaryrefslogtreecommitdiffstats
path: root/codemaker/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-05-13 11:57:17 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-05-14 13:11:50 +0200
commitaf16aa625682b649e8843237652b9246d519cbae (patch)
tree2ea597c328318d6b75761b71af313bef02b5ad77 /codemaker/source
parentDirectly initialize vector in sharedresources_test.cxx (diff)
downloadcore-af16aa625682b649e8843237652b9246d519cbae.tar.gz
core-af16aa625682b649e8843237652b9246d519cbae.zip
Improve loplugin:stringview
Issue the "instead of O[U]String, pass [u16]string_view" diagnostic also for operator call arguments. (The "rather than copy, pass subView()" diagnostic is already part of handleSubExprThatCouldBeView, so no need to repeat it explicitly for operator call arguments.) (And many call sites don't even require an explicit [u16]string_view, esp. with the recent ad48b2b02f83eed41fb1eb8d16de7e804156fcf1 "Optimized OString operator += overloads". Just some test code in sal/qa/ that explicitly tests the O[U]String functionality had to be excluded.) Change-Id: I8d55ba5a7fa16a563f5ffe43d245125c88c793bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115589 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'codemaker/source')
-rw-r--r--codemaker/source/codemaker/global.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/codemaker/source/codemaker/global.cxx b/codemaker/source/codemaker/global.cxx
index 4a6b2cf345c1..e302d7c7742c 100644
--- a/codemaker/source/codemaker/global.cxx
+++ b/codemaker/source/codemaker/global.cxx
@@ -24,6 +24,7 @@
#include <osl/file.hxx>
#include <string.h>
+#include <string_view>
#include <errno.h>
#if defined(_WIN32)
@@ -118,7 +119,7 @@ OString createFileNameFromType( const OString& destination,
if( nIndex == -1 )
break;
- if (buffer.isEmpty() || OString(".") == buffer.getStr())
+ if (buffer.isEmpty() || std::string_view(".") == buffer.getStr())
{
buffer.append(token);
continue;