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
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 311791c..1768204 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -4021,7 +4021,8 @@
inputWindowCommands =
std::move(mInputWindowCommands),
inputFlinger = mInputFlinger, this,
- visibleWindowsChanged, vsyncId, frameTime]() {
+ visibleWindowsChanged, vsyncId,
+ frameTime]() mutable {
SFTRACE_NAME("BackgroundExecutor::updateInputFlinger");
if (updateWindowInfo) {
mWindowInfosListenerInvoker