[webkit-reviews] review granted: [Bug 79356] Little optimization in CSSParser::parseShorthand. : [Attachment 128455] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 23 04:28:51 PST 2012


Kentaro Hara <haraken at chromium.org> has granted Alexis Menard (darktears)
<alexis.menard at openbossa.org>'s request for review:
Bug 79356: Little optimization in CSSParser::parseShorthand.
https://bugs.webkit.org/show_bug.cgi?id=79356

Attachment 128455: Patch
https://bugs.webkit.org/attachment.cgi?id=128455&action=review

------- Additional Comments from Kentaro Hara <haraken at chromium.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=128455&action=review


> Source/WebCore/css/CSSParser.cpp:2682
> +    bool fnd[6]= { false }; // Trust me ;)

"bool fnd[6] = {false, false, false, false, false, false}" might be better
(just for clarification).

"bool fnd[6] = {false}" is equivalent to "bool fnd[6] = {false, 0, 0, 0, 0,
0}". This is OK because false and 0 have the same meaning in this method, but
is a bit confusing.

> Source/WebCore/css/CSSParser.cpp:2686
>	   for (int propIndex = 0; !found && propIndex < numProperties;
++propIndex) {

BTW, (I am not sure how much it is important for performance but) maybe we can
remove this for loop, by moving the propIndex declaration to outside while
(...). Anyway you can try it in another patch.


More information about the webkit-reviews mailing list