D9028: [UDisks DeviceBackend] Slightly optimize

Kai Uwe Broulik noreply at phabricator.kde.org
Tue Nov 28 10:41:53 UTC 2017


broulik created this revision.
broulik added reviewers: Frameworks, davidedmundson.
Restricted Application added a project: Frameworks.

REVISION SUMMARY
  - Avoid double lookup (contains+value)
  - Just `delete take()` instead of contains+value+remove+delete
  - Delay connecting to DBus change signals (this is done in other places, too)
  - Use range-for
  - Use iterator's key() instead of creating temporary `keys()` list

TEST PLAN
  It creates 22 device backends on Dolphin startup, delaying connecting to later saves 1.5ms startup in total.
  
  - Devices still properly populated
  - Mounting and unmounting devices still updates places list live

REPOSITORY
  R245 Solid

REVISION DETAIL
  https://phabricator.kde.org/D9028

AFFECTED FILES
  src/solid/devices/backends/udisks2/udisksdevicebackend.cpp

To: broulik, #frameworks, davidedmundson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20171128/5c8662f7/attachment.html>


More information about the Kde-frameworks-devel mailing list