[Webkit-unassigned] [Bug 72294] Add contains() test to Region

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 15 13:58:18 PST 2011


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





--- Comment #27 from Anders Carlsson <andersca at apple.com>  2011-11-15 13:58:18 PST ---
(In reply to comment #26)
> (From update of attachment 115212 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=115212&action=review
> 
> > Source/WebCore/platform/graphics/Region.h:67
> > +        inline bool operator!=(const Span& other) { return y != other.y || segmentIndex != other.segmentIndex; }
> 
> As a matter of style we almost always implement either neither or both of == and != and implement != by calling ==.
> 
> > Source/WebCore/platform/graphics/Region.h:93
> > +        bool operator==(const Shape& other);
> 
> Ditto.

I also prefer the operators to be free friend functions of Region. Something like 

class Region {

...

friend bool operator==(const Region& a, const Region& b)
{
    return a.m_spans == b.m_spans && a.m_segments == b.m_segments);
}

}:

-- 
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