From 53569c1383928b279a6e9077303cfeca9d86d765 Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Thu, 15 Oct 2015 16:19:17 +0300 Subject: [PATCH] QIODevice::seek(): remove unnecessary check At this point, the buffer is always not empty, as otherwise the offset could not be smaller than it. Change-Id: Iec04c0463623c4ed1e86bbcba2240653f110e315 Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qiodevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index c80c78bd3b..fa91b17747 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -670,7 +670,7 @@ bool QIODevice::seek(qint64 pos) // operation will then refill the buffer. We can optimize this, if we // find that seeking backwards becomes a significant performance hit. d->buffer.clear(); - else if (!d->buffer.isEmpty()) + else d->buffer.skip(offset); #if defined QIODEVICE_DEBUG