diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-05-10 21:51:38 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-05-11 01:57:17 -0700 |
commit | 2dd96b4f393ef83d680c7964d6c2f906c99c01f5 (patch) | |
tree | 15bd02d5d942e4542b0d3650e1a22068a6440363 /qthelper.cpp | |
parent | cf848e52330fa0bca2ccc0fb5de5f2a4033fbafa (diff) | |
download | subsurface-2dd96b4f393ef83d680c7964d6c2f906c99c01f5.tar.gz |
Simplify code.
this is not necessary when you don't have a variable
that has the exact same name as the 'this->variable' name,
also, there's no need to check if a QString is empty
before trying to use the == on them.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qthelper.cpp')
-rw-r--r-- | qthelper.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/qthelper.cpp b/qthelper.cpp index a421d7f66..c51e13628 100644 --- a/qthelper.cpp +++ b/qthelper.cpp @@ -25,11 +25,11 @@ DiveComputerList::~DiveComputerList() bool DiveComputerNode::operator==(const DiveComputerNode &a) const { - return this->model == a.model && - this->deviceId == a.deviceId && - this->firmware == a.firmware && - this->serialNumber == a.serialNumber && - this->nickName == a.nickName; + return model == a.model && + deviceId == a.deviceId && + firmware == a.firmware && + serialNumber == a.serialNumber && + nickName == a.nickName; } bool DiveComputerNode::operator!=(const DiveComputerNode &a) const @@ -39,13 +39,13 @@ bool DiveComputerNode::operator!=(const DiveComputerNode &a) const bool DiveComputerNode::changesValues(const DiveComputerNode &b) const { - if (this->model != b.model || this->deviceId != b.deviceId) { + if (model != b.model || deviceId != b.deviceId) { qDebug("DiveComputerNodes were not for the same DC"); return false; } - return (b.firmware != "" && this->firmware != b.firmware) || - (b.serialNumber != "" && this->serialNumber != b.serialNumber) || - (b.nickName != "" && this->nickName != b.nickName); + return (firmware != b.firmware) || + (serialNumber != b.serialNumber) || + (nickName != b.nickName); } const DiveComputerNode *DiveComputerList::getExact(QString m, uint32_t d) |