1
0
mirror of https://git.suyu.dev/suyu/suyu synced 2025-01-16 04:40:12 -06:00

result: Check against self-assignment in ResultVal's copy assignment operator

Avoids doing work that doesn't need to be done.
This commit is contained in:
Lioncash 2018-03-28 18:01:46 -04:00
parent be4c7ed082
commit 36e60c217a

View File

@ -200,6 +200,9 @@ public:
}
ResultVal& operator=(const ResultVal& o) {
if (this == &o) {
return *this;
}
if (!empty()) {
if (!o.empty()) {
object = o.object;