Don't call ref() in QByteArray::QByteArray()

The call is unnecessary; it does nothing since the shared_null ref count
is negative.

Change-Id: I0d0c35a554e4fc5b734a25dab06f04bee7a9ae24
Reviewed-on: http://codereview.qt-project.org/4637
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
Bradley T. Hughes 2011-09-12 08:44:32 +02:00 committed by Qt by Nokia
parent cfc39289ba
commit eb1f41b8c1

View File

@ -402,7 +402,7 @@ public:
inline DataPtr &data_ptr() { return d; }
};
inline QByteArray::QByteArray(): d(const_cast<Data *>(&shared_null.ba)) { d->ref.ref(); }
inline QByteArray::QByteArray(): d(const_cast<Data *>(&shared_null.ba)) { }
inline QByteArray::~QByteArray() { if (!d->ref.deref()) qFree(d); }
inline int QByteArray::size() const
{ return d->size; }