diff options
author | Lioncash <mathew1800@gmail.com> | 2018-03-28 18:01:46 -0400 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-03-28 18:02:44 -0400 |
commit | 36e60c217a722ae3a63894a263db31e54223ad0c (patch) | |
tree | d06aea6c367b744b02a7d10e0c435b8337244b92 /src/core/hle/result.h | |
parent | be4c7ed0828e47ef44f9cea621946344bec38a54 (diff) |
result: Check against self-assignment in ResultVal's copy assignment operator
Avoids doing work that doesn't need to be done.
Diffstat (limited to 'src/core/hle/result.h')
-rw-r--r-- | src/core/hle/result.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/hle/result.h b/src/core/hle/result.h index 97fef7a48..052f49979 100644 --- a/src/core/hle/result.h +++ b/src/core/hle/result.h @@ -200,6 +200,9 @@ public: } ResultVal& operator=(const ResultVal& o) { + if (this == &o) { + return *this; + } if (!empty()) { if (!o.empty()) { object = o.object; |