mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-10-12 01:57:50 +00: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:
parent
9d3baff255
commit
e6375771e2
1 changed files with 3 additions and 0 deletions
|
@ -200,6 +200,9 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
ResultVal& operator=(const ResultVal& o) {
|
ResultVal& operator=(const ResultVal& o) {
|
||||||
|
if (this == &o) {
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
if (!empty()) {
|
if (!empty()) {
|
||||||
if (!o.empty()) {
|
if (!o.empty()) {
|
||||||
object = o.object;
|
object = o.object;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue