Skip to content

Commit 8b4be56

Browse files
author
Jeff Brown
committed
Delete premature optimization.
This is part of a series of changes to improve input system pipelining. Bug: 5963420 Change-Id: I5c182f6e17d468bf3033125b2094b2baa5b94e81
1 parent 28b5cf1 commit 8b4be56

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

services/input/InputDispatcher.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2076,19 +2076,19 @@ void InputDispatcher::synthesizeCancelationEventsForConnectionLocked(
20762076

20772077
nsecs_t currentTime = now();
20782078

2079-
mTempCancelationEvents.clear();
2079+
Vector<EventEntry*> cancelationEvents;
20802080
connection->inputState.synthesizeCancelationEvents(currentTime,
2081-
mTempCancelationEvents, options);
2081+
cancelationEvents, options);
20822082

2083-
if (!mTempCancelationEvents.isEmpty()) {
2083+
if (!cancelationEvents.isEmpty()) {
20842084
#if DEBUG_OUTBOUND_EVENT_DETAILS
20852085
ALOGD("channel '%s' ~ Synthesized %d cancelation events to bring channel back in sync "
20862086
"with reality: %s, mode=%d.",
2087-
connection->getInputChannelName(), mTempCancelationEvents.size(),
2087+
connection->getInputChannelName(), cancelationEvents.size(),
20882088
options.reason, options.mode);
20892089
#endif
2090-
for (size_t i = 0; i < mTempCancelationEvents.size(); i++) {
2091-
EventEntry* cancelationEventEntry = mTempCancelationEvents.itemAt(i);
2090+
for (size_t i = 0; i < cancelationEvents.size(); i++) {
2091+
EventEntry* cancelationEventEntry = cancelationEvents.itemAt(i);
20922092
switch (cancelationEventEntry->type) {
20932093
case EventEntry::TYPE_KEY:
20942094
logOutboundKeyDetailsLocked("cancel - ",

services/input/InputDispatcher.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,8 +814,6 @@ class InputDispatcher : public InputDispatcherInterface {
814814
Queue<EventEntry> mInboundQueue;
815815
Queue<CommandEntry> mCommandQueue;
816816

817-
Vector<EventEntry*> mTempCancelationEvents;
818-
819817
void dispatchOnceInnerLocked(nsecs_t* nextWakeupTime);
820818

821819
// Enqueues an inbound event. Returns true if mLooper->wake() should be called.

0 commit comments

Comments
 (0)