summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Trotsenko <alex1973tr@gmail.com>2015-07-15 23:14:54 +0300
committerAlex Trotsenko <alex1973tr@gmail.com>2015-07-18 09:05:55 +0000
commit524ae251bb1039b688b8c3fa3192f7465436c961 (patch)
tree63a22682c824cc9fefbfcd1f6123e8767e22458e /src
parent075769ca833331da2800027b5965fd9dee1ffb72 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qiodevice.cpp11
-rw-r--r--src/corelib/io/qiodevice_p.h1
2 files changed, 1 insertions, 11 deletions
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index f0d3250cd2..84a6a1d9cb 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -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) {
diff --git a/src/corelib/io/qiodevice_p.h b/src/corelib/io/qiodevice_p.h
index f4cf387eb5..56a89ab680 100644
--- a/src/corelib/io/qiodevice_p.h
+++ b/src/corelib/io/qiodevice_p.h
@@ -212,7 +212,6 @@ public:
qint64 pos;
qint64 devicePos;
bool baseReadLineDataCalled;
- bool firstRead;
virtual bool putCharHelper(char c);