From af16aa625682b649e8843237652b9246d519cbae Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 13 May 2021 11:57:17 +0200 Subject: 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 --- codemaker/source/codemaker/global.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'codemaker') 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 #include +#include #include #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; -- cgit