diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-09-22 22:19:43 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-09-23 07:27:14 +0200 |
commit | 4706eb93350b2613b1fe6b98afa1243415c40577 (patch) | |
tree | cc6fc582dae595e3db107234bb73901b287a989b /idlc/source | |
parent | 310d43b9a27efc36f2c9e6737a0b5ac3f211bda0 (diff) |
Extend loplugin:stringviewparam to starts/endsWith: idlc
Change-Id: Ib9c97576746b6acfddeacec658a2ae994aa28516
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122497
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'idlc/source')
-rw-r--r-- | idlc/source/astscope.cxx | 6 | ||||
-rw-r--r-- | idlc/source/idlccompile.cxx | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/idlc/source/astscope.cxx b/idlc/source/astscope.cxx index d4c0f954367c..ca6214129c87 100644 --- a/idlc/source/astscope.cxx +++ b/idlc/source/astscope.cxx @@ -20,17 +20,19 @@ #include <sal/config.h> #include <algorithm> +#include <string_view> #include <astscope.hxx> #include <astbasetype.hxx> #include <astinterface.hxx> #include <errorhandler.hxx> +#include <o3tl/string_view.hxx> #include <osl/diagnose.h> -static bool isGlobal(const OString& scopedName) +static bool isGlobal(std::string_view scopedName) { - return scopedName.isEmpty() || scopedName.startsWith(":"); + return scopedName.empty() || o3tl::starts_with(scopedName, ":"); } AstScope::AstScope(NodeType nodeType) diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx index 1902d63e0cad..6db9a615d316 100644 --- a/idlc/source/idlccompile.cxx +++ b/idlc/source/idlccompile.cxx @@ -22,6 +22,7 @@ #include <rtl/ustring.hxx> #include <rtl/strbuf.hxx> #include <o3tl/safeint.hxx> +#include <o3tl/string_view.hxx> #include <osl/process.h> #include <osl/diagnose.h> #include <osl/thread.h> @@ -52,9 +53,9 @@ extern int yydebug; static char tmpFilePattern[512]; -bool isFileUrl(const OString& fileName) +bool isFileUrl(std::string_view fileName) { - return fileName.startsWith("file://"); + return o3tl::starts_with(fileName, "file://"); } OString convertToAbsoluteSystemPath(const OString& fileName) |