summaryrefslogtreecommitdiffstats
path: root/compilerplugins/clang/unusedvariablemore.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-02-11 12:36:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-02-11 12:37:50 +0200
commitcc26cfd379ed32a4c41878370c8db237f327d544 (patch)
treef0a55ac3678c7ed758b4774f5e8bf7217840123f /compilerplugins/clang/unusedvariablemore.cxx
parentloplugin:indentation (diff)
downloadcore-cc26cfd379ed32a4c41878370c8db237f327d544.tar.gz
core-cc26cfd379ed32a4c41878370c8db237f327d544.zip
use more hasPathnamePrefix
Change-Id: I539e6aedad61d80b6ebe80104b77d720072395bd
Diffstat (limited to 'compilerplugins/clang/unusedvariablemore.cxx')
-rw-r--r--compilerplugins/clang/unusedvariablemore.cxx11
1 files changed, 3 insertions, 8 deletions
diff --git a/compilerplugins/clang/unusedvariablemore.cxx b/compilerplugins/clang/unusedvariablemore.cxx
index 2e8b69224aa5..8c153164f174 100644
--- a/compilerplugins/clang/unusedvariablemore.cxx
+++ b/compilerplugins/clang/unusedvariablemore.cxx
@@ -56,22 +56,17 @@ UnusedVariableMore::UnusedVariableMore(const InstantiationData& data)
{
}
-static bool startswith(const std::string& rStr, const char* pSubStr)
-{
- return rStr.compare(0, strlen(pSubStr), pSubStr) == 0;
-}
-
void UnusedVariableMore::run()
{
std::string fn(handler.getMainFileName());
loplugin::normalizeDotDotInFilePath(fn);
// ignore QA folders
- if (startswith(fn, SRCDIR "/sal/qa/"))
+ if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sal/qa/"))
return;
- if (startswith(fn, SRCDIR "/i18npool/qa/"))
+ if (loplugin::hasPathnamePrefix(fn, SRCDIR "/i18npool/qa/"))
return;
- if (startswith(fn, SRCDIR "/sc/qa/"))
+ if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sc/qa/"))
return;
// vector of shared_ptr used to delay destruction