From 92ba4b9cc7bbc2e1818191745d1976f9b915be9a Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 3 Nov 2017 17:44:09 +0100 Subject: 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 --- core/btdiscovery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') diff --git a/core/btdiscovery.cpp b/core/btdiscovery.cpp index 731c4ca4f..ffa2a26f0 100644 --- a/core/btdiscovery.cpp +++ b/core/btdiscovery.cpp @@ -46,7 +46,7 @@ static dc_descriptor_t *getDeviceType(QString btName) } if (!vendor.isEmpty() && !product.isEmpty()) - return(descriptorLookup[vendor + product]); + return(descriptorLookup.value(vendor + product)); return(NULL); } -- cgit v1.2.3-70-g09d2