From ddb47ba8ca88a45d473227bfd11d8199c9b30dd8 Mon Sep 17 00:00:00 2001 From: danieldg Date: Sat, 17 Oct 2009 22:54:57 +0000 Subject: Revert "Remove duplicated function calls when using reference" If these functions are removed, the C++ compiler generates them - badly. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11896 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/base.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include/base.h') diff --git a/include/base.h b/include/base.h index 3d05b15cd..624e2174f 100644 --- a/include/base.h +++ b/include/base.h @@ -88,12 +88,13 @@ class reference : public reference_base public: reference() : value(0) { } reference(T* v) : value(v) { if (value) inc(value); } - reference& operator=(T* v) + reference(const reference& v) : value(v.value) { if (value) inc(value); } + reference& operator=(const reference& other) { - if (v) - inc(v); + if (other.value) + inc(other.value); this->reference::~reference(); - value = v; + value = other.value; return *this; } -- cgit v1.2.3