From 77b23d1b5979ce65058f845f73cb48894ba68325 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 23 Sep 2021 07:31:09 +0200 Subject: Extend loplugin:stringviewparam to starts/endsWith: cpputools Change-Id: I016ca2ecf63d62d7799db1098ba0455e337aa3eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122507 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- cpputools/source/unoexe/unoexe.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cpputools') diff --git a/cpputools/source/unoexe/unoexe.cxx b/cpputools/source/unoexe/unoexe.cxx index 2181e850d7fe..34be8e964ca8 100644 --- a/cpputools/source/unoexe/unoexe.cxx +++ b/cpputools/source/unoexe/unoexe.cxx @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -126,11 +127,11 @@ static bool readOption( OUString * pValue, const char * pOpt, } static bool readOption( bool * pbOpt, const char * pOpt, - sal_uInt32 * pnIndex, const OUString & aArg) + sal_uInt32 * pnIndex, std::u16string_view aArg) { OUString aOpt = OUString::createFromAscii(pOpt); - if(aArg.startsWith("--") && aOpt == aArg.subView(2)) + if(o3tl::starts_with(aArg, u"--") && aOpt == aArg.substr(2)) { ++(*pnIndex); *pbOpt = true; -- cgit