[PATCH RFC] 2.5.73 zlib #2 codefold

Jörn Engel (joern@wohnheim.fh-wedel.de)
Tue, 1 Jul 2003 18:16:37 +0200


This patch folds three calls to memmove_update into one. This is the
same structure that was in the 1.1.3 version of the zlib as well. The
change towards 1.1.4 was mixed with a real bugfix, so it slipped
through my brain.

Jörn

-- 
When you close your hand, you own nothing. When you open it up, you
own the whole world.
-- Li Mu Bai in Tiger & Dragon

--- linux-2.5.73/lib/zlib_inflate/inffast.c~zlib_codefold 2003-06-30 03:57:31.000000000 +0200 +++ linux-2.5.73/lib/zlib_inflate/inffast.c 2003-06-30 04:11:37.000000000 +0200 @@ -99,28 +99,18 @@ /* do the copy */ m -= c; r = q - d; - if (r < s->window) /* wrap if needed */ - { - do { + if (r < s->window) { /* wrap if needed */ + while (r < s->window) { r += s->end - s->window; /* force pointer in window */ - } while (r < s->window); /* covers invalid distances */ + } /* covers invalid distances */ e = s->end - r; - if (c > e) - { + if (c > e) { c -= e; /* wrapped copy */ memmove_update(&q, &r, &e); r = s->window; - memmove_update(&q, &r, &c); - } - else /* normal copy */ - { - memmove_update(&q, &r, &c); } } - else /* normal copy */ - { - memmove_update(&q, &r, &c); - } + memmove_update(&q, &r, &c); break; } else if ((e & 64) == 0) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/