[Webkit-unassigned] [Bug 137918] Use references instead of pointers in EditingStyle

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 13 08:02:42 PST 2014


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

--- Comment #13 from Tibor Mészáros <tmeszaros.u-szeged at partner.samsung.com> ---
(In reply to comment #9)
> Comment on attachment 241350 [details]
> 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.

Ok, I will use nullptr instead of 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.

I have updated this part of the code, as Chris, Csaba and You suggested.

-- 
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/20141113/422dc01a/attachment-0002.html>


More information about the webkit-unassigned mailing list