[webkit-reviews] review granted: [Bug 81070] Avoid StringImpl::getData16SlowCase() when sorting array : [Attachment 131773] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 14 12:37:05 PDT 2012


Geoffrey Garen <ggaren at apple.com> has granted Benjamin Poulain
<benjamin at webkit.org>'s request for review:
Bug 81070: Avoid StringImpl::getData16SlowCase() when sorting array
https://bugs.webkit.org/show_bug.cgi?id=81070

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

------- Additional Comments from Geoffrey Garen <ggaren at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=131773&action=review


> Source/JavaScriptCore/wtf/text/StringImpl.h:782
> +    if (string1 && string2) {

It would be better to NULL check string1 and string2 at the head of the
function, and return early if NULL, rather than NULL checking more than once in
the body of the function, and indenting so much of the code. I think this would
work:

if (!string1)
    return -1;
if (!string2)
    return string1->length();
....


More information about the webkit-reviews mailing list