[Webkit-unassigned] [Bug 121899] Optimize strings copies in srcset parser

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 4 09:52:42 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=121899


Alexey Proskuryakov <ap at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #213362|review?                     |review+, commit-queue-
               Flag|                            |




--- Comment #11 from Alexey Proskuryakov <ap at webkit.org>  2013-10-04 09:51:36 PST ---
(From update of attachment 213362)
View in context: https://bugs.webkit.org/attachment.cgi?id=213362&action=review

> Source/WebCore/html/parser/HTMLParserIdioms.cpp:306
> +    ImageWithScale() : imageURLStart(0), imageURLLength(0), scaleFactor(1.0) { }

I think that the preferred style would be the same as in non-inline case, with each initializer and each brace on its own line.

And we don't add .0 to literal values. Especially in this case, because 1.0 is a double, but scaleFactor is a float.

    ImageWithScale()
        : imageURLStart(0)
        , imageURLLength(0)
        , scaleFactor(1)
     {
     }

> Source/WebCore/html/parser/HTMLParserIdioms.cpp:414
>          ImageWithScale image;
> -        image.imageURL = srcAttribute;
> -        image.scaleFactor = 1.0;
> -
>          imageCandidates.append(image);

This is getting somewhat convoluted. Please rename "image" to "srcPlaceholderImage" for a little more clarity.

> Source/WebCore/html/parser/HTMLParserIdioms.cpp:426
> +    const ImageWithScale &lastCandidate = imageCandidates.last();

The "&" should be attached to type name, 

const ImageWithScale& lastCandidate = imageCandidates.last();

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list