From 36e60c217a722ae3a63894a263db31e54223ad0c Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 28 Mar 2018 18:01:46 -0400 Subject: result: Check against self-assignment in ResultVal's copy assignment operator Avoids doing work that doesn't need to be done. --- src/core/hle/result.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/core') 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; -- cgit v1.2.3