Bug 123706 - Remove code duplications in createFontCustomPlatformData()
Summary: Remove code duplications in createFontCustomPlatformData()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Patrick R. Gansterer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-03 10:10 PST by Patrick R. Gansterer
Modified: 2013-11-04 17:29 PST (History)
1 user (show)

See Also:


Attachments
Patch (17.98 KB, patch)
2013-11-04 16:36 PST, Patrick R. Gansterer
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.