From: Yuxi Zhang Date: Mon, 11 Jan 2010 17:28:30 +0000 (+0100) Subject: gzip -d: use memcpy more often X-Git-Tag: v1.4~6 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=17822e2cab5e47d73f224a688be8013c34f990f7;p=debian%2Fgzip gzip -d: use memcpy more often * inflate.c (inflate_codes): Use memcpy (rather than slower memcopy-like code) in more cases. --- diff --git a/inflate.c b/inflate.c index 5b68314..75353e2 100644 --- a/inflate.c +++ b/inflate.c @@ -589,7 +589,8 @@ int bl, bd; /* number of bits decoded by tl[] and td[] */ do { n -= (e = (e = WSIZE - ((d &= WSIZE-1) > w ? d : w)) > n ? n : e); #if !defined(NOMEMCPY) && !defined(DEBUG) - if (d < w && w - d >= e) + unsigned int delta = w > d ? w - d : d - w; + if (delta >= e) { memcpy(slide + w, slide + d, e); w += e;