diff options
author | 2024-11-05 06:18:26 +0000 | |
---|---|---|
committer | 2024-11-05 06:18:26 +0000 | |
commit | 56978ea18fd233f4cf6f6bd2ac2f2edaf85f37b6 (patch) | |
tree | 6659f3c0ff5ce1dfa61249fb0ffbad2396889168 | |
parent | 835351257e19a20115b979accc6e7bde1bf61fd6 (diff) | |
parent | 9210f10dd023b93c3e506b3073ebff72d1419388 (diff) |
Merge "Avoid unnecessary WindowInfo copies" into main
-rw-r--r-- | services/inputflinger/dispatcher/InputDispatcher.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp index 4f9d9e43a3..755995c15f 100644 --- a/services/inputflinger/dispatcher/InputDispatcher.cpp +++ b/services/inputflinger/dispatcher/InputDispatcher.cpp @@ -836,13 +836,9 @@ bool isStylusActiveInDisplay(ui::LogicalDisplayId displayId, } Result<void> validateWindowInfosUpdate(const gui::WindowInfosUpdate& update) { - struct HashFunction { - size_t operator()(const WindowInfo& info) const { return info.id; } - }; - - std::unordered_set<WindowInfo, HashFunction> windowSet; + std::unordered_set<int32_t> windowIds; for (const WindowInfo& info : update.windowInfos) { - const auto [_, inserted] = windowSet.insert(info); + const auto [_, inserted] = windowIds.insert(info.id); if (!inserted) { return Error() << "Duplicate entry for " << info; } |