diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-12 10:50:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-14 07:54:28 +0200 |
commit | bc2101646bc6e63944c42500af5a15134b9b2d17 (patch) | |
tree | ca1da50da2e3e76eef650a1ae3956c16e0a19f33 /compilerplugins/clang/stringviewparam.cxx | |
parent | ad97694737c99889bc0eb21efccb83768d510361 (diff) |
loplugin:stringviewparam improvements
improve the check by checking for methods that exclude
using string_view, rather than checking for methods that
__can__ use string_view, which leads to exposing
some holes in our o3tl/string_view.hxx coverage.
Change-Id: Ic9dd60441c671f502692f9cd2a1bb67301c4b960
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150277
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang/stringviewparam.cxx')
-rw-r--r-- | compilerplugins/clang/stringviewparam.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/compilerplugins/clang/stringviewparam.cxx b/compilerplugins/clang/stringviewparam.cxx index 1540f03291c3..d16c306f6326 100644 --- a/compilerplugins/clang/stringviewparam.cxx +++ b/compilerplugins/clang/stringviewparam.cxx @@ -137,12 +137,11 @@ DeclRefExpr const* relevantCXXMemberCallExpr(CXXMemberCallExpr const* expr) else if (auto const i = d->getIdentifier()) { auto const n = i->getName(); - if (n == "endsWith" || n == "isEmpty" || n == "startsWith" || n == "subView" - || n == "indexOf" || n == "lastIndexOf" || n == "compareTo" || n == "match" - || n == "trim" || n == "toInt32" || n == "toUInt32" || n == "toInt64" || n == "toDouble" - || n == "equalsIgnoreAsciiCase" || n == "compareToIgnoreAsciiCase" || n == "getToken" - || n == "copy" || n == "equalsAscii" || n == "equalsAsciiL" - || n == "matchIgnoreAsciiCase") + if (!(n == "getLength" || n == "getStr" || n == "convertToString" || n == "replace" + || n == "replaceAll" || n == "replaceAt" || n == "replaceFirst" + || n == "toAsciiLowerCase" || n == "toAsciiUpperCase" || n == "toUtf8" + || n == "iterateCodePoints" || n == "startsWithIgnoreAsciiCase" || n == "toUInt64" + || n == "toFloat" || n == "toBoolean")) { good = true; } |