Bug 65760 - CSSSelector::selectorText should use StringBuilder instead of +=
Summary: CSSSelector::selectorText should use StringBuilder instead of +=
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-05 02:14 PDT by Oliver Varga
Modified: 2012-11-18 02:09 PST (History)
6 users (show)

See Also:


Attachments
Patch (13.54 KB, patch)
2011-08-29 23:09 PDT, Shinya Kawanaka
morrita: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Shinya Kawanaka 2011-08-29 23:09:36 PDT
Created attachment 105583 [details]
Patch
Comment 2 Hajime Morrita 2011-10-02 22:25:04 PDT
Comment on attachment 105583 [details]
Patch

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

> Source/WebCore/css/CSSSelector.cpp:629
>      if (CSSSelector* tagHistory = cs->tagHistory()) {

How about just to return and eliminate temporal "str" ?
Also, you can do early return by checking tagHistory != NULL.
Comment 3 Hajime Morrita 2011-10-02 22:27:13 PDT
Anyway, is it possible to eliminate whole "+" by moving the last block to the head of the function?
Comment 4 Renata Hodovan 2012-11-18 02:09:05 PST
It's already fixed in r126967;