[webkit-reviews] review granted: [Bug 174374] Improve font matching with FontConfig and FreeType : [Attachment 315173] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 11 21:44:28 PDT 2017


Michael Catanzaro <mcatanzaro at igalia.com> has granted Timothy Hatcher
<timothy at hatcher.name>'s request for review:
Bug 174374: Improve font matching with FontConfig and FreeType
https://bugs.webkit.org/show_bug.cgi?id=174374

Attachment 315173: Patch

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




--- Comment #11 from Michael Catanzaro <mcatanzaro at igalia.com> ---
Comment on attachment 315173
  --> https://bugs.webkit.org/attachment.cgi?id=315173
Patch

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

> Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp:381
> +	   if (!equalIgnoringASCIICase(familyNameAfterConfiguration,
familyNameAfterMatching) && !isCommonlyUsedGenericFamily(familyNameString) &&
!areStronglyAliased(familyNameAfterConfiguration, familyNameAfterMatching))
> +	       continue;
> +
> +	   matchedFontFamily = true;
> +	   break;

You can simplify this significantly by inverting the condition:

if (equalIgnoringASCIICase(...) || isCommonlyUsedGenericFamily(...) ||
areStronglyAliased(...)) {
    matchedFontFamily = true;
    break;
}

Then you don't need a continue statement at all.


More information about the webkit-reviews mailing list