Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10e8010b authored by Ady Abraham's avatar Ady Abraham Committed by Android (Google) Code Review
Browse files

Merge "Fix a bugprone-suspicious-memory-comparison warning"

parents 5df98c24 a58d441d
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -71,9 +71,14 @@ public:
            , right(rect.fRight)
            , bottom(rect.fBottom) {}

    friend int operator==(const Rect& a, const Rect& b) { return !memcmp(&a, &b, sizeof(a)); }
    friend int operator==(const Rect& a, const Rect& b) {
        return a.left == b.left &&
               a.top == b.top &&
               a.right == b.right &&
               a.bottom == b.bottom;
    }

    friend int operator!=(const Rect& a, const Rect& b) { return memcmp(&a, &b, sizeof(a)); }
    friend int operator!=(const Rect& a, const Rect& b) { return !(a == b); }

    inline void clear() { left = top = right = bottom = 0.0f; }