[server] Reduce overhead of pointersForSurface
ClosedPublic

Authored by graesslin on Nov 7 2016, 2:11 PM.

Details

Summary

In SeatInterface we need to get all PointerInterfaces related to a given
Surface (Client) and call a method on it. The implementation we had so
far went through all Pointers and put all PointerInterfaces into a new
temporary QVector. In most cases all we did then was iterating over the
returned vector.

Which means we created a temporary vector for nothing.

This change implements a kind of std::for_each with the constraints of
the previously used pointersForSurface which does the check that Surface
is not null and that the client matches. If a PointerInterface is found
for that, the passed in method is invoked on it.

Diff Detail

Repository
R127 KWayland
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 7975.Nov 7 2016, 2:11 PM
graesslin retitled this revision from to [server] Reduce overhead of pointersForSurface.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added a reviewer: Plasma on Wayland.
Restricted Application added a project: Plasma on Wayland. · View Herald TranscriptNov 7 2016, 2:11 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
sebas accepted this revision.Nov 16 2016, 3:06 PM
sebas added a reviewer: sebas.
This revision is now accepted and ready to land.Nov 16 2016, 3:06 PM
This revision was automatically updated to reflect the committed changes.