[server] Reduce overhead of pointersForSurface

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

Description

[server] Reduce overhead of pointersForSurface

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.

Reviewers: Plasma on Wayland

Subscribers: plasma-devel

Tags: Plasma on Wayland

Differential Revision: https://phabricator.kde.org/D3295

Details

Committed
graesslinNov 24 2016, 8:19 AM
Differential Revision
D3295: [server] Reduce overhead of pointersForSurface
Parents
R127:ba0f83400b3a: Add FreeBSD to metainfo.yaml.
Branches
Unknown
Tags
Unknown