[webkit-reviews] review granted: [Bug 176860] Move code using Vector::map to WTF:map : [Attachment 320904] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 15 09:04:17 PDT 2017


Jer Noble <jer.noble at apple.com> has granted  review:
Bug 176860: Move code using Vector::map to WTF:map
https://bugs.webkit.org/show_bug.cgi?id=176860

Attachment 320904: Patch

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




--- Comment #14 from Jer Noble <jer.noble at apple.com> ---
Comment on attachment 320904
  --> https://bugs.webkit.org/attachment.cgi?id=320904
Patch

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

> Source/WebCore/page/Settings.cpp:805
> -    m_mediaContentTypesRequiringHardwareSupport =
contentTypes.split(":").map(ContentType::create);
> +    StringView contentTypesView { contentTypes };
> +
> +    m_mediaContentTypesRequiringHardwareSupport.shrink(0);
> +    for (auto type : contentTypesView.split(':'))
> +	   m_mediaContentTypesRequiringHardwareSupport.append(ContentType {
type.toString() });

nit: I don't think you need the local variable here; this could be written:

for (auto type : StringView(contentTypes).split(':'))

I'm pretty sure the right hand side of the iterator statement stays alive
across the whole for loop. (I could be wrong though.)


More information about the webkit-reviews mailing list