Bug 123706

Summary: Remove code duplications in createFontCustomPlatformData()
Product: WebKit Reporter: Patrick R. Gansterer <paroga>
Component: New BugsAssignee: Patrick R. Gansterer <paroga>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Patrick R. Gansterer 2013-11-03 10:10:12 PST
Remove code duplications in createFontCustomPlatformData()
Comment 1 Patrick R. Gansterer 2013-11-04 16:36:27 PST
Created attachment 215968 [details]
Patch
Comment 2 Darin Adler 2013-11-04 17:24:51 PST
Comment on attachment 215968 [details]
Patch

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

> Source/WebCore/loader/cache/CachedFont.cpp:103
> +        OpenTypeSanitizer sanitizer(buffer);
> +        RefPtr<SharedBuffer> transcodeBuffer = sanitizer.sanitize();

I would like this better as a single line:

    RefPtr<SharedBuffer> sanitizedBuffer = OpenTypeSanitizer(buffer).sanitize();

> Source/WebCore/loader/cache/CachedFont.cpp:117
> +        m_fontData = buffer ? createFontCustomPlatformData(*buffer) : nullptr;

We could use an if statement instead of a ? : since we already know that m_fontData is null here.
Comment 3 WebKit Commit Bot 2013-11-04 17:29:48 PST
Comment on attachment 215968 [details]
Patch

Clearing flags on attachment: 215968

Committed r158623: <http://trac.webkit.org/changeset/158623>
Comment 4 WebKit Commit Bot 2013-11-04 17:29:50 PST
All reviewed patches have been landed.  Closing bug.