From a36d602d0a48226e3c9958739dc52254549e7a93 Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Sun, 31 May 2015 15:13:03 +0200
Subject: [PATCH] speedup comparison on shared objects

---
 alib2data/src/common/wrapper.hpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/alib2data/src/common/wrapper.hpp b/alib2data/src/common/wrapper.hpp
index 4528d5e727..73cee0919b 100644
--- a/alib2data/src/common/wrapper.hpp
+++ b/alib2data/src/common/wrapper.hpp
@@ -45,26 +45,32 @@ public:
 	}
 
 	bool operator>=(const wrapper& other) const {
+		if(this->data.get() == other.data.get()) return true;
 		return *(this->data) >= *(other.data);
 	}
 
 	bool operator<=(const wrapper& other) const {
+		if(this->data.get() == other.data.get()) return true;
 		return *(this->data) <= *(other.data);
 	}
 
 	bool operator>(const wrapper& other) const {
+		if(this->data.get() == other.data.get()) return false;
 		return *(this->data) > *(other.data);
 	}
 
 	bool operator<(const wrapper& other) const {
+		if(this->data.get() == other.data.get()) return false;
 		return *(this->data) < *(other.data);
 	}
 
 	bool operator!=(const wrapper& other) const {
+		if(this->data.get() == other.data.get()) return false;
 		return *(this->data) != *(other.data);
 	}
 
 	bool operator==(const wrapper& other) const {
+		if(this->data.get() == other.data.get()) return true;
 		return *(this->data) == *(other.data);
 	}
 
-- 
GitLab