mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	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>
This commit is contained in:
		
							parent
							
								
									cf848e5233
								
							
						
					
					
						commit
						2dd96b4f39
					
				
					 1 changed files with 9 additions and 9 deletions
				
			
		
							
								
								
									
										18
									
								
								qthelper.cpp
									
										
									
									
									
								
							
							
						
						
									
										18
									
								
								qthelper.cpp
									
										
									
									
									
								
							|  | @ -25,11 +25,11 @@ DiveComputerList::~DiveComputerList() | ||||||
| 
 | 
 | ||||||
| bool DiveComputerNode::operator==(const DiveComputerNode &a) const | bool DiveComputerNode::operator==(const DiveComputerNode &a) const | ||||||
| { | { | ||||||
| 	return this->model == a.model && | 	return model == a.model && | ||||||
| 	       this->deviceId == a.deviceId && | 	       deviceId == a.deviceId && | ||||||
| 	       this->firmware == a.firmware && | 	       firmware == a.firmware && | ||||||
| 	       this->serialNumber == a.serialNumber && | 	       serialNumber == a.serialNumber && | ||||||
| 	       this->nickName == a.nickName; | 	       nickName == a.nickName; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool DiveComputerNode::operator!=(const DiveComputerNode &a) const | 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 | 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"); | 		qDebug("DiveComputerNodes were not for the same DC"); | ||||||
| 		return false; | 		return false; | ||||||
| 	} | 	} | ||||||
| 	return (b.firmware != "" && this->firmware != b.firmware) || | 	return (firmware != b.firmware) || | ||||||
| 	       (b.serialNumber != "" && this->serialNumber != b.serialNumber) || | 	       (serialNumber != b.serialNumber) || | ||||||
| 	       (b.nickName != "" && this->nickName != b.nickName); | 	       (nickName != b.nickName); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| const DiveComputerNode *DiveComputerList::getExact(QString m, uint32_t d) | const DiveComputerNode *DiveComputerList::getExact(QString m, uint32_t d) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue