Skip to content

Commit

Permalink
replaced string comparisons with equal operator
Browse files Browse the repository at this point in the history
  • Loading branch information
thunder422 committed Nov 25, 2012
1 parent 710414e commit 11ae686
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion main.cpp
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions table.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions test_ibcp.cpp
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 11ae686

Please sign in to comment.