summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Patrick Williams <pdwilliams@google.com> 2024-11-07 12:57:27 -0600
committer Patrick Williams <pdwilliams@google.com> 2024-11-07 12:59:59 -0600
commita4eb946da83d1e63ece1775c260498565b499714 (patch)
tree92f4c62175dd3e59ce121fba3c4a77e1cf4a7ff6
parent525e783ff7cff593e7e5f2054d0e16e625e70033 (diff)
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
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 311791cb29..17682045d9 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -4021,7 +4021,8 @@ void SurfaceFlinger::updateInputFlinger(VsyncId vsyncId, TimePoint frameTime) {
inputWindowCommands =
std::move(mInputWindowCommands),
inputFlinger = mInputFlinger, this,
- visibleWindowsChanged, vsyncId, frameTime]() {
+ visibleWindowsChanged, vsyncId,
+ frameTime]() mutable {
SFTRACE_NAME("BackgroundExecutor::updateInputFlinger");
if (updateWindowInfo) {
mWindowInfosListenerInvoker