Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
c463ff98
Commit
c463ff98
authored
Nov 20, 2021
by
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/characters/CharacterColor.h
View file @
c463ff98
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment