[Code cleanup] Don't remove an event from queue if it is not intended to
Right now at PassthroughTouchEventQueue::ProcessTouchAck, we fetch an event from outstanding_touches_ queue, modify its ack info and latency info, and put the event back in the queue again. Note that the outstanding_touches_ is a std::set sorted according to each event's unique_touch_id. Setting ack info and latency info won't change the unique_touch_id on the event, in order words, it won't affect the ordering of the event in that set. So it is un-necessary to remove the event and put it back in the queue again. This CL does clean up. It sets ack and latency info directly on the event in the outstanding_touches_. The only catch here is that the iter of a std::set is always const, so we have to do a const_cast. Bug: None Change-Id: I45cf1001ce82b3fd876b856618c99df25d5b9b4a Reviewed-on: https://chromium-review.googlesource.com/c/1297714Reviewed-by:Navid Zolghadr <nzolghadr@chromium.org> Commit-Queue: Xida Chen <xidachen@chromium.org> Cr-Commit-Position: refs/heads/master@{#607245}
Showing
Please register or sign in to comment