QIODevice: remove superfluous member
In current implementation, d->firstRead doesn't provide any performance improvement. Change-Id: I5d6e765a7d49cb546998b2c3e908e3c5600e70b1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
075769ca83
commit
524ae251bb
@ -139,7 +139,6 @@ QIODevicePrivate::QIODevicePrivate()
|
||||
: openMode(QIODevice::NotOpen), buffer(QIODEVICE_BUFFERSIZE),
|
||||
pos(0), devicePos(0)
|
||||
, baseReadLineDataCalled(false)
|
||||
, firstRead(true)
|
||||
, accessMode(Unset)
|
||||
#ifdef QT_NO_QOBJECT
|
||||
, q_ptr(0)
|
||||
@ -464,7 +463,6 @@ void QIODevice::setOpenMode(OpenMode openMode)
|
||||
#endif
|
||||
d->openMode = openMode;
|
||||
d->accessMode = QIODevicePrivate::Unset;
|
||||
d->firstRead = true;
|
||||
if (!isReadable())
|
||||
d->buffer.clear();
|
||||
}
|
||||
@ -556,7 +554,6 @@ bool QIODevice::open(OpenMode mode)
|
||||
d->pos = (mode & Append) ? size() : qint64(0);
|
||||
d->buffer.clear();
|
||||
d->accessMode = QIODevicePrivate::Unset;
|
||||
d->firstRead = true;
|
||||
#if defined QIODEVICE_DEBUG
|
||||
printf("%p QIODevice::open(0x%x)\n", this, quint32(mode));
|
||||
#endif
|
||||
@ -586,7 +583,6 @@ void QIODevice::close()
|
||||
d->errorString.clear();
|
||||
d->pos = 0;
|
||||
d->buffer.clear();
|
||||
d->firstRead = true;
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -816,12 +812,7 @@ qint64 QIODevice::read(char *data, qint64 maxSize)
|
||||
bufferReadChunkSize, readSoFar - bufferReadChunkSize);
|
||||
#endif
|
||||
} else {
|
||||
if (d->firstRead) {
|
||||
// this is the first time the file has been read, check it's valid and set up pos pointers
|
||||
// for fast pos updates.
|
||||
CHECK_READABLE(read, qint64(-1));
|
||||
d->firstRead = false;
|
||||
}
|
||||
CHECK_READABLE(read, qint64(-1));
|
||||
}
|
||||
|
||||
if (maxSize > 0 && !deviceAtEof) {
|
||||
|
@ -212,7 +212,6 @@ public:
|
||||
qint64 pos;
|
||||
qint64 devicePos;
|
||||
bool baseReadLineDataCalled;
|
||||
bool firstRead;
|
||||
|
||||
virtual bool putCharHelper(char c);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user