mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Replace QMap::operator[] with QMap::value()
QMap::operator[] creates a new default constructed entry in the map if no entry with the given key exists. While not problematic (since typically nullptrs are inserted) this is usually not what you want for read access. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
		
							parent
							
								
									e3580eda6f
								
							
						
					
					
						commit
						92ba4b9cc7
					
				
					 4 changed files with 4 additions and 4 deletions
				
			
		|  | @ -482,7 +482,7 @@ void DownloadFromDCWidget::updateDeviceEnabled() | |||
| { | ||||
| 	// Set up the DC descriptor
 | ||||
| 	dc_descriptor_t *descriptor = NULL; | ||||
| 	descriptor = descriptorLookup[ui.vendor->currentText() + ui.product->currentText()]; | ||||
| 	descriptor = descriptorLookup.value(ui.vendor->currentText() + ui.product->currentText()); | ||||
| 
 | ||||
| 	// call dc_descriptor_get_transport to see if the dc_transport_t is DC_TRANSPORT_SERIAL
 | ||||
| 	if (dc_descriptor_get_transport(descriptor) == DC_TRANSPORT_SERIAL) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue