summaryrefslogtreecommitdiff
path: root/helpcompiler
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2015-11-15 07:42:02 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-11-15 06:46:07 +0000
commit3bdd176731c351638f541a37b94094124f3c9f52 (patch)
treeccae69c3871620923bea1c5a048f44ad428853c0 /helpcompiler
parent7272e8df62a12d6172b297d7a82a0265cd1bc44a (diff)
cppcheck:stlIfStrFind
"Inefficient usage of string::find() in condition; string::compare() would be faster." Change-Id: I90403b1d05eff6499c10be33068e5fd4fed30b62 Reviewed-on: https://gerrit.libreoffice.org/19966 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'helpcompiler')
-rw-r--r--helpcompiler/source/HelpCompiler.cxx4
-rw-r--r--helpcompiler/source/HelpLinker.cxx2
2 files changed, 3 insertions, 3 deletions
diff --git a/helpcompiler/source/HelpCompiler.cxx b/helpcompiler/source/HelpCompiler.cxx
index af8154749795..5d3709105287 100644
--- a/helpcompiler/source/HelpCompiler.cxx
+++ b/helpcompiler/source/HelpCompiler.cxx
@@ -335,7 +335,7 @@ void myparser::traverse( xmlNodePtr parentNode )
std::string hid;
- if (branch.find("hid") == 0)
+ if (branch.compare("hid") == 0)
{
size_t index = branch.find('/');
if (index != std::string::npos)
@@ -493,7 +493,7 @@ bool HelpCompiler::compile()
if ( !bExtensionMode && !fileName.empty())
{
- if (fileName.find("/text/") == 0)
+ if (fileName.compare("/text/") == 0)
{
int len = strlen("/text/");
actMod = fileName.substr(len);
diff --git a/helpcompiler/source/HelpLinker.cxx b/helpcompiler/source/HelpLinker.cxx
index 8b8f89563f27..33e684a88ecc 100644
--- a/helpcompiler/source/HelpLinker.cxx
+++ b/helpcompiler/source/HelpLinker.cxx
@@ -400,7 +400,7 @@ void HelpLinker::link() throw(HelpProcessingException, BasicCodeTagger::TaggerEx
continue;
std::string documentPath = streamTable.document_path;
- if (documentPath.find("/") == 0)
+ if (documentPath.compare("/") == 0)
documentPath = documentPath.substr(1);
std::string documentJarfile = streamTable.document_module + ".jar";