diff options
author | João Abecasis <joao@trolltech.com> | 2010-01-13 17:13:11 (GMT) |
---|---|---|
committer | João Abecasis <joao@trolltech.com> | 2010-01-18 14:17:27 (GMT) |
commit | 4974742bb85b5f22ade3e1a59c2b5fe7ac84e684 (patch) | |
tree | 76c1b9c6c2cd6f4ed009b0f66a72ce5209f63b18 | |
parent | 54069f7c2c235dc9e302f96a6111bf6cd34a766b (diff) | |
download | Qt-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.cpp | 8 |
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; } /*! |