From 36e60c217a722ae3a63894a263db31e54223ad0c Mon Sep 17 00:00:00 2001
From: Lioncash <mathew1800@gmail.com>
Date: Wed, 28 Mar 2018 18:01:46 -0400
Subject: [PATCH] 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(+)

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;