diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-17 19:12:12 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-17 19:12:12 +0000 |
commit | 9fb2d54a3873f7081ddfb25285a8890344672796 (patch) | |
tree | da10a4989ee5ccd9d8e3668f4073fac955cced17 /include/base.h | |
parent | 9db7af579c46a9f0379fdf71fb773a0a76a94846 (diff) |
Remove duplicated function calls when using reference
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11889 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/base.h')
-rw-r--r-- | include/base.h | 9 |
1 files changed, 4 insertions, 5 deletions
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<T>& operator=(const reference<T>& other) + reference<T>& operator=(T* v) { - if (other.value) - inc(other.value); + if (v) + inc(v); this->reference::~reference(); - value = other.value; + value = v; return *this; } |