diff options
author | Joerg Bornemann <joerg.bornemann@trolltech.com> | 2009-07-14 12:13:58 (GMT) |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@trolltech.com> | 2009-07-14 12:18:24 (GMT) |
commit | 9e00fcde7a13bb561aebaa5e84c94297089f0c7f (patch) | |
tree | 7437a22f9dce69c0dba8d17cfd23c2baa010931a | |
parent | ec823a0414ea1bb00fd52b0922ad50e4061fe660 (diff) | |
download | Qt-9e00fcde7a13bb561aebaa5e84c94297089f0c7f.zip Qt-9e00fcde7a13bb561aebaa5e84c94297089f0c7f.tar.gz Qt-9e00fcde7a13bb561aebaa5e84c94297089f0c7f.tar.bz2 |
micro optimization in qfsfileengine_win.cpp
Use the LARGE_INTEGER union properly and don't do unnessecary bit
shifting.
Reviewed-by: mauricek
-rw-r--r-- | src/corelib/io/qfsfileengine_win.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index ee49853..618566a 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -608,8 +608,7 @@ qint64 QFSFileEnginePrivate::nativePos() const // This approach supports large files. LARGE_INTEGER currentFilePos; LARGE_INTEGER offset; - offset.LowPart = 0; - offset.HighPart = 0; + offset.QuadPart = 0; if (!ptrSetFilePointerEx(fileHandle, offset, ¤tFilePos, FILE_CURRENT)) { thatQ->setError(QFile::UnspecifiedError, qt_error_string()); return 0; @@ -652,8 +651,7 @@ bool QFSFileEnginePrivate::nativeSeek(qint64 pos) // This approach supports large files. LARGE_INTEGER currentFilePos; LARGE_INTEGER offset; - offset.LowPart = (unsigned int)(quint64(pos) & Q_UINT64_C(0xffffffff)); - offset.HighPart = (unsigned int)((quint64(pos) >> 32) & Q_UINT64_C(0xffffffff)); + offset.QuadPart = pos; if (ptrSetFilePointerEx(fileHandle, offset, ¤tFilePos, FILE_BEGIN) == 0) { thatQ->setError(QFile::UnspecifiedError, qt_error_string()); return false; |