[webkit-reviews] review granted: [Bug 223880] Stop using a hash as key in the FontCascadeCache : [Attachment 424579] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 29 15:06:48 PDT 2021


Darin Adler <darin at apple.com> has granted Chris Dumez <cdumez at apple.com>'s
request for review:
Bug 223880: Stop using a hash as key in the FontCascadeCache
https://bugs.webkit.org/show_bug.cgi?id=223880

Attachment 424579: Patch

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




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

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

> Source/WebCore/platform/graphics/FontCache.cpp:590
> +    for (unsigned i = 0; i < key.families.size(); ++i) {
> +	   auto& family = key.families[i];

Unlike the == function, this can use the modern for loop.

> Source/WebCore/platform/graphics/FontCache.h:199
> +namespace WTF {

We don’t need to put this in the WTF namespace. It doesn’t have to the the
default hash for FontCascadeCacheKey. It can just be the hash we pass to the
HashMap template.

> Source/WebCore/platform/graphics/FontCache.h:219
> +typedef HashMap<FontCascadeCacheKey, std::unique_ptr<FontCascadeCacheEntry>>
FontCascadeCache;

How about using instead of typedef since we have to touch this line?


More information about the webkit-reviews mailing list