[Webkit-unassigned] [Bug 137918] Use references instead of pointers in EditingStyle
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Nov 11 09:35:34 PST 2014
https://bugs.webkit.org/show_bug.cgi?id=137918
--- Comment #9 from Darin Adler <darin at apple.com> ---
Comment on attachment 241350
--> https://bugs.webkit.org/attachment.cgi?id=241350
Patch v3
View in context: https://bugs.webkit.org/attachment.cgi?id=241350&action=review
> Source/WebCore/editing/EditingStyle.cpp:135
> + if (RefPtr<CSSValue> propertyCSSValue = style.getPropertyCSSValue(propertyID))
> + return propertyCSSValue.release();
> + return 0;
There is no reason for this if statement. Just:
return style.getPropertyCSSValue(propertyID);
Also, please use nullptr, not 0, in the future.
>> Source/WebCore/editing/EditingStyle.cpp:1520
>> - if (!is<CSSPrimitiveValue>(fontWeight))
>> + if (!is<CSSPrimitiveValue>(&fontWeight))
>
> No, this is wrong. You will do an unnecessary null check. Just use if (!is<CSSPrimitiveValue>(fontWeight))
There is no need for this change. The is template should work on references as well as pointers.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20141111/b9f583d8/attachment-0002.html>
More information about the webkit-unassigned
mailing list