Fix my fix for KCompressionDevice::seek
ClosedPublic

Authored by aacid on Feb 4 2017, 10:15 PM.

Diff Detail

Repository
R243 KArchive
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
aacid updated this revision to Diff 10919.Feb 4 2017, 10:15 PM
aacid retitled this revision from to Fix my fix for KCompressionDevice::seek.
aacid updated this object.
aacid edited the test plan for this revision. (Show Details)
aacid added a reviewer: dfaure.
aacid set the repository for this revision to R243 KArchive.
Restricted Application added a project: Frameworks. · View Herald TranscriptFeb 4 2017, 10:15 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
dfaure added inline comments.Feb 4 2017, 11:02 PM
src/kcompressiondevice.cpp
208

I wonder if we could avoid seeking twice, by doing seek(pos) only in the other cases (the deviceReadPos ==pos early return, and the pos == 0 case above).

We don't need the seek(pos) in this if(), nor in the else().

aacid updated this revision to Diff 10921.Feb 4 2017, 11:37 PM

We can save some seek calls, but we still need it in the if, there's nothing that guaranteers that "QIODevice::pos" will be d->deviceReadPos so we need to seek to d->deviceReadPos.

dfaure accepted this revision.Feb 4 2017, 11:52 PM
dfaure edited edge metadata.

Ah yes of course, this is what I meant. TV distracted me :)

This revision is now accepted and ready to land.Feb 4 2017, 11:52 PM
This revision was automatically updated to reflect the committed changes.