mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-11 21:04:07 -07:00
[Fix-Warnings] Remove redundant parentheses
This commit is contained in:
parent
858361e6d3
commit
8ddbdf31f9
75 changed files with 269 additions and 269 deletions
|
|
@ -18,7 +18,7 @@ bool AbstractDecklistCardNode::compareNumber(AbstractDecklistNode *other) const
|
|||
if (other2) {
|
||||
int n1 = getNumber();
|
||||
int n2 = other2->getNumber();
|
||||
return (n1 != n2) ? (n1 > n2) : compareName(other);
|
||||
return n1 != n2 ? n1 > n2 : compareName(other);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -28,7 +28,7 @@ bool AbstractDecklistCardNode::compareName(AbstractDecklistNode *other) const
|
|||
{
|
||||
auto *other2 = dynamic_cast<AbstractDecklistCardNode *>(other);
|
||||
if (other2) {
|
||||
return (getName() > other2->getName());
|
||||
return getName() > other2->getName();
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,13 +50,13 @@ bool SideboardPlan::readElement(QXmlStreamReader *xml)
|
|||
m.set_start_zone(xml->readElementText().toStdString());
|
||||
else if (childName2 == "target_zone")
|
||||
m.set_target_zone(xml->readElementText().toStdString());
|
||||
} else if (xml->isEndElement() && (childName2 == "move_card_to_zone")) {
|
||||
} else if (xml->isEndElement() && childName2 == "move_card_to_zone") {
|
||||
moveList.append(m);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (xml->isEndElement() && (childName == "sideboard_plan"))
|
||||
} else if (xml->isEndElement() && childName == "sideboard_plan")
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -148,7 +148,7 @@ bool DeckList::readElement(QXmlStreamReader *xml)
|
|||
delete newSideboardPlan;
|
||||
}
|
||||
}
|
||||
} else if (xml->isEndElement() && (childName == "cockatrice_deck")) {
|
||||
} else if (xml->isEndElement() && childName == "cockatrice_deck") {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -674,10 +674,10 @@ static QString computeDeckHash(const InnerDecklistNode *root)
|
|||
}
|
||||
cardList.sort();
|
||||
QByteArray deckHashArray = QCryptographicHash::hash(cardList.join(";").toUtf8(), QCryptographicHash::Sha1);
|
||||
quint64 number = (((quint64)(unsigned char)deckHashArray[0]) << 32) +
|
||||
(((quint64)(unsigned char)deckHashArray[1]) << 24) +
|
||||
(((quint64)(unsigned char)deckHashArray[2] << 16)) +
|
||||
(((quint64)(unsigned char)deckHashArray[3]) << 8) + (quint64)(unsigned char)deckHashArray[4];
|
||||
quint64 number = ((quint64)(unsigned char)deckHashArray[0] << 32) +
|
||||
((quint64)(unsigned char)deckHashArray[1] << 24) +
|
||||
((quint64)(unsigned char)deckHashArray[2] << 16) +
|
||||
((quint64)(unsigned char)deckHashArray[3] << 8) + (quint64)(unsigned char)deckHashArray[4];
|
||||
return QString::number(number, 32).rightJustified(8, '0');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ bool InnerDecklistNode::compareNumber(AbstractDecklistNode *other) const
|
|||
if (other2) {
|
||||
int n1 = recursiveCount(true);
|
||||
int n2 = other2->recursiveCount(true);
|
||||
return (n1 != n2) ? (n1 > n2) : compareName(other);
|
||||
return n1 != n2 ? n1 > n2 : compareName(other);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -132,7 +132,7 @@ bool InnerDecklistNode::compareName(AbstractDecklistNode *other) const
|
|||
{
|
||||
auto *other2 = dynamic_cast<InnerDecklistNode *>(other);
|
||||
if (other2) {
|
||||
return (getName() > other2->getName());
|
||||
return getName() > other2->getName();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -154,7 +154,7 @@ bool InnerDecklistNode::readElement(QXmlStreamReader *xml)
|
|||
xml->attributes().value("collectorNumber").toString(), xml->attributes().value("uuid").toString());
|
||||
newCard->readElement(xml);
|
||||
}
|
||||
} else if (xml->isEndElement() && (childName == "zone"))
|
||||
} else if (xml->isEndElement() && childName == "zone")
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -182,7 +182,7 @@ QVector<QPair<int, int>> InnerDecklistNode::sort(Qt::SortOrder order)
|
|||
|
||||
// Sort temporary list
|
||||
auto cmp = [order](const auto &a, const auto &b) {
|
||||
return (order == Qt::AscendingOrder) ? (b.second->compare(a.second)) : (a.second->compare(b.second));
|
||||
return order == Qt::AscendingOrder ? b.second->compare(a.second) : a.second->compare(b.second);
|
||||
};
|
||||
|
||||
std::sort(tempList.begin(), tempList.end(), cmp);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue