Commit c463ff98 authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Inline CharacterColor comparison operators and pass by value

No need for them to be out of line or be passed by reference.
parent 8b9d1971
......@@ -184,12 +184,18 @@ public:
* Compares two colors and returns true if they represent the same color value and
* use the same color space.
*/
friend constexpr bool operator==(const CharacterColor &a, const CharacterColor &b);
friend constexpr bool operator==(const CharacterColor a, const CharacterColor b)
{
return a._colorSpace == b._colorSpace && a._u == b._u && a._v == b._v && a._w == b._w;
}
/**
* Compares two colors and returns true if they represent different color values
* or use different color spaces.
*/
friend constexpr bool operator!=(const CharacterColor &a, const CharacterColor &b);
friend constexpr bool operator!=(const CharacterColor a, const CharacterColor b)
{
return !operator==(a, b);
}
private:
quint8 _colorSpace;
......@@ -200,16 +206,6 @@ private:
quint8 _w;
};
constexpr bool operator==(const CharacterColor &a, const CharacterColor &b)
{
return a._colorSpace == b._colorSpace && a._u == b._u && a._v == b._v && a._w == b._w;
}
constexpr bool operator!=(const CharacterColor &a, const CharacterColor &b)
{
return !operator==(a, b);
}
constexpr QColor color256(quint8 u, const QColor *base)
{
// 0.. 16: system colors
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment