Bug 53871

Summary: Refactor Font::normalizeSpaces() to avoid an extra String copy.
Product: WebKit Reporter: Andreas Kling <kling>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: krit
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Proposed patch none

Description Andreas Kling 2011-02-06 07:23:41 PST
Font::normalizeSpaces() could take an UChar*/length pair as arguments instead of a String.
All call sites create a temporary String for passing to this function, and there is some cleverness in normalizeSpaces() to reuse that String if no spaces are normalized.
We should let normalizeSpaces() do the String creation which means we'll always make 1 String instead of 1 in the best case and 2 in the worst case.
Comment 1 Andreas Kling 2011-02-06 07:24:48 PST
Created attachment 81402 [details]
Proposed patch
Comment 2 Dirk Schulze 2011-02-06 08:17:49 PST
Comment on attachment 81402 [details]
Proposed patch

r=me
Comment 3 Andreas Kling 2011-02-06 08:22:31 PST
Comment on attachment 81402 [details]
Proposed patch

Clearing flags on attachment: 81402

Committed r77768: <http://trac.webkit.org/changeset/77768>
Comment 4 Andreas Kling 2011-02-06 08:22:39 PST
All reviewed patches have been landed.  Closing bug.