summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Abecasis <joao@trolltech.com>2010-01-13 17:13:11 (GMT)
committerJoão Abecasis <joao@trolltech.com>2010-01-18 14:17:27 (GMT)
commit4974742bb85b5f22ade3e1a59c2b5fe7ac84e684 (patch)
tree76c1b9c6c2cd6f4ed009b0f66a72ce5209f63b18
parent54069f7c2c235dc9e302f96a6111bf6cd34a766b (diff)
downloadQt-4974742bb85b5f22ade3e1a59c2b5fe7ac84e684.zip
Qt-4974742bb85b5f22ade3e1a59c2b5fe7ac84e684.tar.gz
Qt-4974742bb85b5f22ade3e1a59c2b5fe7ac84e684.tar.bz2
QFile::readData: Simplify code
Reviewed-by: Markus Goetz
-rw-r--r--src/corelib/io/qfile.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index df470b9..728c316 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -1517,18 +1517,14 @@ qint64 QFile::readData(char *data, qint64 len)
if (!d->ensureFlushed())
return -1;
- qint64 ret = -1;
qint64 read = d->fileEngine->read(data, len);
- if (read != -1)
- ret = read;
-
- if(ret < 0) {
+ if(read < 0) {
QFile::FileError err = d->fileEngine->error();
if(err == QFile::UnspecifiedError)
err = QFile::ReadError;
d->setError(err, d->fileEngine->errorString());
}
- return ret;
+ return read;
}
/*!