Subversion Repositories SvarDOS

Rev

Rev 2102 | Rev 2108 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2102 Rev 2106
Line 402... Line 402...
402
  unsigned char litqueuelen = 0;
402
  unsigned char litqueuelen = 0;
403
 
403
 
404
  /* read src byte by byte, len times, each time look for a match of 15,14,13..2 chars in the back buffer */
404
  /* read src byte by byte, len times, each time look for a match of 15,14,13..2 chars in the back buffer */
405
  while (len > 0) {
405
  while (len > 0) {
406
    unsigned short matchlen;
406
    unsigned short matchlen;
-
 
407
    unsigned short minmatch;
407
    unsigned short offset;
408
    unsigned short offset;
408
    matchlen = 16;
409
    matchlen = 16;
409
    if (len < matchlen) matchlen = len;
410
    if (len < matchlen) matchlen = len;
410
 
411
 
-
 
412
    /* look for a minimum match of 2 bytes, unless I have some pending literal bytes
-
 
413
     * awaiting, in which case I am going through a new data pattern and it is more
-
 
414
     * efficient to wait for a 3-bytes match before breaking the literal string */
-
 
415
    if (litqueuelen != 0) {
-
 
416
      minmatch = 3;
-
 
417
    } else {
-
 
418
      minmatch = 2;
-
 
419
    }
-
 
420
 
411
    for (; matchlen > 1; matchlen--) {
421
    for (; matchlen >= minmatch; matchlen--) {
412
      /* start at -matchlen and try to match something moving backward */
422
      /* start at -matchlen and try to match something moving backward */
413
      unsigned short maxoffset = 4096;
423
      unsigned short maxoffset = 4096;
414
      if (maxoffset > bytesprocessed) maxoffset = bytesprocessed;
424
      if (maxoffset > bytesprocessed) maxoffset = bytesprocessed;
415
 
425
 
416
      for (offset = matchlen; offset <= maxoffset; offset++) {
426
      for (offset = matchlen; offset <= maxoffset; offset++) {