OSDN Git Service

remove unused and internal QList::detachShared() method
authorIvailo Monev <xakepa10@laimg.moc>
Wed, 20 Nov 2019 02:21:07 +0000 (02:21 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Wed, 20 Nov 2019 02:21:07 +0000 (02:21 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/core/tools/qlist.cpp
src/core/tools/qlist.h

index b447072..b332e33 100644 (file)
@@ -575,15 +575,6 @@ void **QListData::erase(void **xi)
     \internal
 */
 
-/*! \fn void QList::detachShared()
-
-    \internal
-
-    like detach(), but does nothing if we're shared_null.
-    This prevents needless mallocs, and makes QList more exception safe
-    in case of cleanup work done in destructors on empty lists.
-*/
-
 /*! \fn bool QList::isDetached() const
 
     \internal
index 0545b95..fb97239 100644 (file)
@@ -119,13 +119,6 @@ public:
 
     inline void detach() { if (d->ref != 1) detach_helper(); }
 
-    inline void detachShared()
-    {
-        // The "this->" qualification is needed for GCCE.
-        if (d->ref != 1 && this->d != &QListData::shared_null)
-            detach_helper();
-    }
-
     inline bool isDetached() const { return d->ref == 1; }
     inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
     inline bool isSharedWith(const QList<T> &other) const { return d == other.d; }