mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 22:01:13 +00:00
C++: use default operator==
Since we now use C++20, we can simplify our code a bit
This commit is contained in:
parent
36e07b8801
commit
319704d3fb
8 changed files with 13 additions and 75 deletions
|
@ -42,23 +42,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
friend bool operator==(const PathData &a, const PathData &b)
|
||||
{
|
||||
if (a.data.tag != b.data.tag)
|
||||
return false;
|
||||
switch (a.data.tag) {
|
||||
case cbindgen_private::types::PathData::Tag::Elements:
|
||||
return a.data.elements._0 == b.data.elements._0;
|
||||
case cbindgen_private::types::PathData::Tag::Events:
|
||||
return a.data.events._0 == b.data.events._0 && b.data.events._0 == b.data.events._0;
|
||||
case cbindgen_private::types::PathData::Tag::Commands:
|
||||
return a.data.commands._0 == b.data.commands._0;
|
||||
case cbindgen_private::types::PathData::Tag::None:
|
||||
return true;
|
||||
}
|
||||
return false; // unreachable
|
||||
}
|
||||
friend bool operator!=(const PathData &a, const PathData &b) { return !(a == b); }
|
||||
friend bool operator==(const PathData &a, const PathData &b) = default;
|
||||
|
||||
private:
|
||||
static SharedVector<PathElement> elements_from_array(const PathElement *firstElement,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue