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:
Berthold Stoeger 2017-11-03 17:44:09 +01:00 committed by Lubomir I. Ivanov
parent e3580eda6f
commit 92ba4b9cc7
4 changed files with 4 additions and 4 deletions

View file

@ -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);
}