[UDisksDeviceBackend] Avoid double lookup
ClosedPublic

Authored by broulik on Feb 19 2018, 2:35 PM.

Details

Summary

QMap::value() would return a nullptr if there is no such element.
It is also perfectly valid to delete a nullptr

Test Plan

Compiles, devices still work

Diff Detail

Repository
R245 Solid
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Feb 19 2018, 2:35 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptFeb 19 2018, 2:35 PM
broulik requested review of this revision.Feb 19 2018, 2:35 PM
apol accepted this revision.Feb 19 2018, 2:38 PM
apol added a subscriber: apol.
apol added inline comments.
src/solid/devices/backends/udisks2/udisksdevicebackend.cpp
55 ↗(On Diff #27545)

Here it was triple look-up! ;)

This revision is now accepted and ready to land.Feb 19 2018, 2:38 PM
This revision was automatically updated to reflect the committed changes.