perf: reduce repaints amount caused by selection (#4889)
Co-authored-by: nerix <nero.9@hotmail.de> Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -38,7 +38,7 @@ struct SelectionItem {
|
||||
|
||||
bool operator!=(const SelectionItem &b) const
|
||||
{
|
||||
return this->operator==(b);
|
||||
return !this->operator==(b);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -62,6 +62,16 @@ struct Selection {
|
||||
}
|
||||
}
|
||||
|
||||
bool operator==(const Selection &b) const
|
||||
{
|
||||
return this->start == b.start && this->end == b.end;
|
||||
}
|
||||
|
||||
bool operator!=(const Selection &b) const
|
||||
{
|
||||
return !this->operator==(b);
|
||||
}
|
||||
|
||||
bool isEmpty() const
|
||||
{
|
||||
return this->start == this->end;
|
||||
|
||||
Reference in New Issue
Block a user