Wasted vector capacity under CSSFontFace::setUnicodeRange()
Created attachment 425352 [details] Patch
Comment on attachment 425352 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=425352&action=review r=me > Source/WebCore/css/CSSFontFace.cpp:274 > auto& list = downcast<CSSValueList>(unicodeRange); What about using `map` instead? ``` auto ranges = WTF::map(downcast<CSSValueList>(unicodeRange), [] (auto& rangeValue) -> UnicodeRange { return { range.from(), range.to() }; }); ```
(In reply to Devin Rousso from comment #2) > Comment on attachment 425352 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=425352&action=review > > r=me > > > Source/WebCore/css/CSSFontFace.cpp:274 > > auto& list = downcast<CSSValueList>(unicodeRange); > > What about using `map` instead? > ``` > auto ranges = WTF::map(downcast<CSSValueList>(unicodeRange), [] (auto& > rangeValue) -> UnicodeRange { > return { range.from(), range.to() }; > }); > ``` CSSValueList doesn't quite allow map() to work.
https://trac.webkit.org/changeset/275638/webkit
<rdar://problem/76369477>