Skip to content

Commit a4eb946

Browse files
Avoid unnecessary copies in updateInputFlinger
Lambda capture values are const by default, preventing a move from occurring despite using std::move. Declaring the lambda "mutable" fixes this. Bug: 352744079 Flag: EXEMPT refactor Test: presubmits Change-Id: I322e8a6c85c810cc90669d043c4f72feb57a97ae
1 parent 525e783 commit a4eb946

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

services/surfaceflinger/SurfaceFlinger.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4021,7 +4021,8 @@ void SurfaceFlinger::updateInputFlinger(VsyncId vsyncId, TimePoint frameTime) {
40214021
inputWindowCommands =
40224022
std::move(mInputWindowCommands),
40234023
inputFlinger = mInputFlinger, this,
4024-
visibleWindowsChanged, vsyncId, frameTime]() {
4024+
visibleWindowsChanged, vsyncId,
4025+
frameTime]() mutable {
40254026
SFTRACE_NAME("BackgroundExecutor::updateInputFlinger");
40264027
if (updateWindowInfo) {
40274028
mWindowInfosListenerInvoker

0 commit comments

Comments
 (0)