From 11ae68634b76c322bd01b51c76ff51ab3bba0d04 Mon Sep 17 00:00:00 2001 From: Thunder422 Date: Sun, 25 Nov 2012 08:25:56 -0500 Subject: [PATCH] replaced string comparisons with equal operator --- main.cpp | 2 +- table.cpp | 4 ++-- test_ibcp.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index a1e2942..9ed3014 100644 --- a/main.cpp +++ b/main.cpp @@ -44,7 +44,7 @@ void printGplHeader(QTextStream &cout, const QString &name) // function to print version number bool ibcpVersion(QTextStream &cout, const QString &name, QStringList &args) { - if (args.count() != 2 || args.at(1).compare("-v") != 0) + if (args.count() != 2 || args.at(1) != "-v") { return false; // not our option or extra/invalid options } diff --git a/table.cpp b/table.cpp index 6b52454..6e4dfec 100644 --- a/table.cpp +++ b/table.cpp @@ -1477,7 +1477,7 @@ QStringList Table::initialize(void) if (m_entry[i].flags & Multiple_Flag != 0) { ExprInfo *exprInfo2 = m_entry[i + 1].exprInfo; - if (m_entry[i].name.compare(m_entry[i + 1].name) != 0) + if (m_entry[i].name != m_entry[i + 1].name) { errorList.append(QString("Multiple entry '%1' name " "mis-match '%2'").arg(m_entry[i].name) @@ -1796,7 +1796,7 @@ Code Table::search(Code index, int nArguments) const { for (Code i = index + 1; m_entry[i].name != NULL; i++) { - if (m_entry[index].name.compare(m_entry[i].name) == 0 + if (m_entry[index].name == m_entry[i].name && nArguments == nOperands(i)) { return i; diff --git a/test_ibcp.cpp b/test_ibcp.cpp index 1b00172..b612cc5 100644 --- a/test_ibcp.cpp +++ b/test_ibcp.cpp @@ -62,7 +62,7 @@ Tester::Tester(QStringList &args) } // fall through case 3: - if (args.at(1).compare("-t") == 0) + if (args.at(1) == "-t") { if (args.count() == 2) { @@ -105,7 +105,7 @@ Tester::Tester(QStringList &args) bool Tester::isOption(const QString &arg, const QString &exp, enum Option option, QString name) { - if (arg.compare(exp) == 0) + if (arg == exp) { m_option = option; m_testName = name;