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>
This commit is contained in:
@@ -103,7 +103,7 @@ bool PassStuffByRef::isFat(QualType type, std::string * name) {
|
|||||||
}
|
}
|
||||||
*name = type.getUnqualifiedType().getCanonicalType().getAsString();
|
*name = type.getUnqualifiedType().getCanonicalType().getAsString();
|
||||||
if (*name == "class rtl::OUString" || *name == "class rtl::OString"
|
if (*name == "class rtl::OUString" || *name == "class rtl::OString"
|
||||||
|| name->find("class com::sun::star::uno::Sequence") == 0)
|
|| name->compare("class com::sun::star::uno::Sequence") == 0)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -335,7 +335,7 @@ void myparser::traverse( xmlNodePtr parentNode )
|
|||||||
|
|
||||||
std::string hid;
|
std::string hid;
|
||||||
|
|
||||||
if (branch.find("hid") == 0)
|
if (branch.compare("hid") == 0)
|
||||||
{
|
{
|
||||||
size_t index = branch.find('/');
|
size_t index = branch.find('/');
|
||||||
if (index != std::string::npos)
|
if (index != std::string::npos)
|
||||||
@@ -493,7 +493,7 @@ bool HelpCompiler::compile()
|
|||||||
|
|
||||||
if ( !bExtensionMode && !fileName.empty())
|
if ( !bExtensionMode && !fileName.empty())
|
||||||
{
|
{
|
||||||
if (fileName.find("/text/") == 0)
|
if (fileName.compare("/text/") == 0)
|
||||||
{
|
{
|
||||||
int len = strlen("/text/");
|
int len = strlen("/text/");
|
||||||
actMod = fileName.substr(len);
|
actMod = fileName.substr(len);
|
||||||
|
@@ -400,7 +400,7 @@ void HelpLinker::link() throw(HelpProcessingException, BasicCodeTagger::TaggerEx
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
std::string documentPath = streamTable.document_path;
|
std::string documentPath = streamTable.document_path;
|
||||||
if (documentPath.find("/") == 0)
|
if (documentPath.compare("/") == 0)
|
||||||
documentPath = documentPath.substr(1);
|
documentPath = documentPath.substr(1);
|
||||||
|
|
||||||
std::string documentJarfile = streamTable.document_module + ".jar";
|
std::string documentJarfile = streamTable.document_module + ".jar";
|
||||||
|
Reference in New Issue
Block a user