mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb/CSS: Use default operator== where possible in GridTrackSize
No behavior change.
This commit is contained in:
parent
8d83dce1d7
commit
286771457a
Notes:
github-actions[bot]
2025-06-13 17:58:43 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 286771457a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5080
Reviewed-by: https://github.com/trflynn89
2 changed files with 6 additions and 33 deletions
|
@ -243,15 +243,6 @@ Vector<ExplicitGridTrack> GridTrackSizeList::track_list() const
|
|||
return track_list;
|
||||
}
|
||||
|
||||
bool GridTrackSizeList::operator==(GridTrackSizeList const& other) const
|
||||
{
|
||||
if (m_list.size() != other.m_list.size())
|
||||
return false;
|
||||
for (size_t i = 0; i < m_list.size(); ++i) {
|
||||
if (m_list[i] != other.m_list[i])
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bool GridTrackSizeList::operator==(GridTrackSizeList const& other) const = default;
|
||||
|
||||
}
|
||||
|
|
|
@ -55,11 +55,7 @@ public:
|
|||
Size css_size() const;
|
||||
|
||||
String to_string() const;
|
||||
bool operator==(GridSize const& other) const
|
||||
{
|
||||
return m_type == other.type()
|
||||
&& m_value == other.m_value;
|
||||
}
|
||||
bool operator==(GridSize const& other) const = default;
|
||||
|
||||
private:
|
||||
Type m_type;
|
||||
|
@ -74,10 +70,7 @@ public:
|
|||
GridSize max_grid_size() const& { return m_max_grid_size; }
|
||||
|
||||
String to_string() const;
|
||||
bool operator==(GridFitContent const& other) const
|
||||
{
|
||||
return m_max_grid_size == other.m_max_grid_size;
|
||||
}
|
||||
bool operator==(GridFitContent const& other) const = default;
|
||||
|
||||
private:
|
||||
GridSize m_max_grid_size;
|
||||
|
@ -92,11 +85,7 @@ public:
|
|||
GridSize max_grid_size() const& { return m_max_grid_size; }
|
||||
|
||||
String to_string() const;
|
||||
bool operator==(GridMinMax const& other) const
|
||||
{
|
||||
return m_min_grid_size == other.min_grid_size()
|
||||
&& m_max_grid_size == other.max_grid_size();
|
||||
}
|
||||
bool operator==(GridMinMax const& other) const = default;
|
||||
|
||||
private:
|
||||
GridSize m_min_grid_size;
|
||||
|
@ -107,7 +96,7 @@ struct GridLineNames {
|
|||
Vector<String> names;
|
||||
|
||||
String to_string() const;
|
||||
bool operator==(GridLineNames const& other) const { return names == other.names; }
|
||||
bool operator==(GridLineNames const& other) const = default;
|
||||
};
|
||||
|
||||
class GridTrackSizeList {
|
||||
|
@ -150,14 +139,7 @@ public:
|
|||
Type type() const& { return m_type; }
|
||||
|
||||
String to_string() const;
|
||||
bool operator==(GridRepeat const& other) const
|
||||
{
|
||||
if (m_type != other.type())
|
||||
return false;
|
||||
if (m_type == Type::Default && m_repeat_count != other.repeat_count())
|
||||
return false;
|
||||
return m_grid_track_size_list == other.grid_track_size_list();
|
||||
}
|
||||
bool operator==(GridRepeat const& other) const = default;
|
||||
|
||||
private:
|
||||
Type m_type;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue