Bug 111530 - [EFL][WK2] Use Vector::reserveInitialCapacity() in WebEventFactory::createWebTouchEvent()
Summary: [EFL][WK2] Use Vector::reserveInitialCapacity() in WebEventFactory::createWeb...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-05 23:55 PST by Chris Dumez
Modified: 2013-03-06 01:29 PST (History)
8 users (show)

See Also:


Attachments
Patch (2.51 KB, patch)
2013-03-05 23:59 PST, Chris Dumez
benjamin: review+
benjamin: commit-queue-
Details | Formatted Diff | Diff
Patch for landing (2.53 KB, patch)
2013-03-06 00:58 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
Patch
Comment 2 Benjamin Poulain 2013-03-06 00:53:51 PST
Comment on attachment 191662 [details]
Patch

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.