[Scummvm-devel] [Scummvm-cvs-logs] SF.net SVN: scummvm:[42249] scummvm/branches/gsoc2009-draci/engines/draci

Paul Gilbert paulfgilbert at gmail.com
Wed Jul 8 07:23:09 CEST 2009


On Wed, Jul 8, 2009 at 2:42 PM, Robert Špalek <rspalek at gmail.com> wrote:

> On Tue, Jul 7, 2009 at 5:34 PM, <dkasak13 at users.sourceforge.net> wrote:
>
>> +               // Account for GPL jump that some commands set
>> +               reader.seek(reader.pos() + _jump);
>>
>
> not sure how efficient
> the stream reader is, i.e. whether it tests the new position for inequality or whether it always refills its buffers.  maybe it would be nicer to test if (_jump != 0) { ... }
>

Additionally, if we're talking about a standard stream reader here (i.e.
derived from SeekableReadStream), then the seek method has an optional
second parameter that can be used to specify that the offset is relative,
rather than absolute. So a cleaner implementation would be:

if (_jump != 0)
     reader.seek(_jump, SEEK_CUR);

Paul.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scummvm.org/pipermail/scummvm-devel/attachments/20090708/f99da731/attachment.html>


More information about the Scummvm-devel mailing list