[webkit-reviews] review granted: [Bug 209086] Color Picker crashes on touch : [Attachment 393666] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 16 12:50:00 PDT 2020


Darin Adler <darin at apple.com> has granted Megan Gardner
<megan_gardner at apple.com>'s request for review:
Bug 209086: Color Picker crashes on touch
https://bugs.webkit.org/show_bug.cgi?id=209086

Attachment 393666: Patch

https://bugs.webkit.org/attachment.cgi?id=393666&action=review




--- Comment #6 from Darin Adler <darin at apple.com> ---
Comment on attachment 393666
  --> https://bugs.webkit.org/attachment.cgi?id=393666
Patch

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

> Source/WebCore/ChangeLog:8
> +	   Vector sizing lost in refactor. Not perfomance sensitive code, so
just expanding vector as needed.

Thanks for fixing my mistake!

There are really two questions about using append. One you have answered here.
The other is whether the vector lives a long time -- if it did we would want to
make sure it doesn’t use a lot of space. I think it does not live a long time.

If the vector did live a long time, there are two ways we could deal with that:

1) Less effective: Add a call to suggestions.shrinkToFit() after the loop.

2) More effective: Leave this using uncheckedAppend and add this line of code
before the loop:

   
suggestions.reserveInitialCapacity(std::distance(dataList->suggestions().begin(
), { }));

I’m going to assume it does not live a long time.


More information about the webkit-reviews mailing list