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