Branch: Tag:

2003-04-15

2003-04-15 13:42:34 by Marcus Comstedt <marcus@mc.pp.se>

Optimized seek in read mode.

Rev: src/modules/Gz/module.pmod.in:1.11

1: - // $Id: module.pmod.in,v 1.10 2003/04/15 13:39:31 marcus Exp $ + // $Id: module.pmod.in,v 1.11 2003/04/15 13:42:34 marcus Exp $   #pike __REAL_VERSION__      inherit @module@;
201:    pos += file_pos;    if(pos < 0)    return -1; +  if(pos < file_pos) {    if(!f->seek || f->seek(0)<0)    return -1;    file_pos = 0;    read_buf = "";    crc = crc32(""); -  +  } else +  pos -= file_pos;    while(pos > 0) {    string r = read(pos>16384? 16384:pos);    if(!sizeof(r))