trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpe...@apache.org
Subject [trafficserver] 03/33: TS-4425: Remove unused Ptr::to_ptr() method.
Date Wed, 11 May 2016 20:31:27 GMT
This is an automated email from the ASF dual-hosted git repository.

jpeach pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit 0660bc53daef5c80484042c2192cdf2876acd5ec
Author: James Peach <jpeach@apache.org>
AuthorDate: Wed May 4 22:02:35 2016 -0700

    TS-4425: Remove unused Ptr::to_ptr() method.
---
 lib/ts/Ptr.h | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/lib/ts/Ptr.h b/lib/ts/Ptr.h
index b7b86be..dd87657 100644
--- a/lib/ts/Ptr.h
+++ b/lib/ts/Ptr.h
@@ -109,17 +109,6 @@ public:
   Ptr<T> &operator=(const Ptr<T> &);
   Ptr<T> &operator=(T *);
 
-  T *
-  to_ptr()
-  {
-    if (m_ptr && m_ptr->m_refcount == 1) {
-      T *ptr = m_ptr;
-      m_ptr = 0;
-      ptr->m_refcount = 0;
-      return ptr;
-    }
-    return 0;
-  }
   operator T *() const { return (m_ptr); }
   T *operator->() const { return (m_ptr); }
   T &operator*() const { return (*m_ptr); }
@@ -128,16 +117,19 @@ public:
   {
     return (m_ptr == p);
   }
+
   int
   operator==(const Ptr<T> &p)
   {
     return (m_ptr == p.m_ptr);
   }
+
   int
   operator!=(const T *p)
   {
     return (m_ptr != p);
   }
+
   int
   operator!=(const Ptr<T> &p)
   {
@@ -208,6 +200,7 @@ Ptr<T>::operator=(T *p)
 
   return (*this);
 }
+
 template <class T>
 inline void
 Ptr<T>::clear()
@@ -218,6 +211,7 @@ Ptr<T>::clear()
     m_ptr = NULL;
   }
 }
+
 template <class T>
 inline Ptr<T> &
 Ptr<T>::operator=(const Ptr<T> &src)

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>.

Mime
View raw message