summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/expressionalwayszero.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/expressionalwayszero.cxx
parentb289cf8de23afa2e647b7b2045487bf3ac757e2a (diff)
use more hasPathnamePrefix
Change-Id: I539e6aedad61d80b6ebe80104b77d720072395bd
Diffstat (limited to 'compilerplugins/clang/expressionalwayszero.cxx')
-rw-r--r--compilerplugins/clang/expressionalwayszero.cxx18
1 files changed, 7 insertions, 11 deletions
diff --git a/compilerplugins/clang/expressionalwayszero.cxx b/compilerplugins/clang/expressionalwayszero.cxx
index d53d20316a5d..c3bc0bb0730f 100644
--- a/compilerplugins/clang/expressionalwayszero.cxx
+++ b/compilerplugins/clang/expressionalwayszero.cxx
@@ -23,10 +23,6 @@
namespace {
-static bool startswith(const std::string& rStr, const char* pSubStr) {
- return rStr.compare(0, strlen(pSubStr), pSubStr) == 0;
-}
-
class ExpressionAlwaysZero:
public loplugin::FilteringPlugin<ExpressionAlwaysZero>
{
@@ -40,23 +36,23 @@ public:
loplugin::normalizeDotDotInFilePath(fn);
// encoding of constant value for binary file format
- if (startswith(fn, SRCDIR "/package/source/zipapi/ZipFile.cxx"))
+ if (loplugin::hasPathnamePrefix(fn, SRCDIR "/package/source/zipapi/ZipFile.cxx"))
return;
// some auto-generated static data
- if (startswith(fn, SRCDIR "/sal/textenc/tables.cxx"))
+ if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sal/textenc/tables.cxx"))
return;
// nested conditional defines that are not worth cleaning up
- if (startswith(fn, SRCDIR "/opencl/source/openclwrapper.cxx"))
+ if (loplugin::hasPathnamePrefix(fn, SRCDIR "/opencl/source/openclwrapper.cxx"))
return;
// some kind of matrix calculation, the compiler will optimise it out anyway
- if (startswith(fn, SRCDIR "/vcl/source/gdi/bitmap4.cxx"))
+ if (loplugin::hasPathnamePrefix(fn, SRCDIR "/vcl/source/gdi/bitmap4.cxx"))
return;
// code follows a pattern
- if (startswith(fn, SRCDIR "/svx/source/svdraw/svdhdl.cxx"))
+ if (loplugin::hasPathnamePrefix(fn, SRCDIR "/svx/source/svdraw/svdhdl.cxx"))
return;
// looks like some kind of TODO marker
- if (startswith(fn, SRCDIR "/chart2/source/view/main/PropertyMapper.cxx")
- || startswith(fn, SRCDIR "/sc/source/core/data/formulacell.cxx"))
+ if (loplugin::hasPathnamePrefix(fn, SRCDIR "/chart2/source/view/main/PropertyMapper.cxx")
+ || loplugin::hasPathnamePrefix(fn, SRCDIR "/sc/source/core/data/formulacell.cxx"))
return;
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
}