Bug 111530

Summary: [EFL][WK2] Use Vector::reserveInitialCapacity() in WebEventFactory::createWebTouchEvent()
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit EFLAssignee: Chris Dumez <cdumez>
Severity: Normal CC: benjamin, enmi.lee, gyuyoung.kim, kenneth, laszlo.gombos, lucas.de.marchi, rakuco, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Description Flags
benjamin: review+, benjamin: commit-queue-
Patch for landing none

Description Chris Dumez 2013-03-05 23:55:46 PST
In WebEventFactory::createWebTouchEvent(), when constructor the vector of touch points, we already know in advance the total number of touch points. Therefore, we should leverage WTF::Vector::reserveCapacity() and WTF::Vector::uncheckedAppend() to save some capacity checks.
Comment 1 Chris Dumez 2013-03-05 23:59:48 PST
Created attachment 191662 [details]
Comment 2 Benjamin Poulain 2013-03-06 00:53:51 PST
Comment on attachment 191662 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=191662&action=review

Why not...

> Source/WebKit2/Shared/efl/WebEventFactory.cpp:225
> +    touchPoints.reserveCapacity(eina_list_count(points));

This should be reserveInitialCapacity.
Comment 3 Chris Dumez 2013-03-06 00:58:32 PST
Created attachment 191676 [details]
Patch for landing
Comment 4 WebKit Review Bot 2013-03-06 01:29:50 PST
Comment on attachment 191676 [details]
Patch for landing

Clearing flags on attachment: 191676

Committed r144898: <http://trac.webkit.org/changeset/144898>
Comment 5 WebKit Review Bot 2013-03-06 01:29:54 PST
All reviewed patches have been landed.  Closing bug.