]> git.saurik.com Git - wxWidgets.git/commitdiff
don't duplicate copy ctor and assignment operator code in wxCharTypeBuffer<T>, it...
authorVáclav Slavík <vslavik@fastmail.fm>
Sat, 28 Mar 2009 09:35:53 +0000 (09:35 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sat, 28 Mar 2009 09:35:53 +0000 (09:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59900 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/buffer.h

index e3e1ac0e66bc27c0b71451ad0cacf1c55a334671..3be01fee36b5821c0fcab3347dfe843ec4564176 100644 (file)
@@ -245,10 +245,7 @@ public:
     }
 
     wxCharTypeBuffer(const wxCharTypeBuffer& src)
-    {
-        this->m_data = src.m_data;
-        this->IncRef();
-    }
+        : wxScopedCharTypeBuffer<T>(src) {}
 
     wxCharTypeBuffer& operator=(const CharType *str)
     {
@@ -261,13 +258,7 @@ public:
 
     wxCharTypeBuffer& operator=(const wxCharTypeBuffer& src)
     {
-        if ( &src == this )
-            return *this;
-
-        this->DecRef();
-        this->m_data = src.m_data;
-        this->IncRef();
-
+        wxScopedCharTypeBuffer<T>::operator=(src);
         return *this;
     }