mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: Joakim Tjernlund <Joakim.Tjernlund@lumentis.se>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH RFC] 2.5.73 zlib #2 codefold
Date: Tue, 1 Jul 2003 18:16:37 +0200	[thread overview]
Message-ID: <20030701161637.GC25363@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <20030701154522.GB25363@wohnheim.fh-wedel.de>

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)

  reply	other threads:[~2003-07-01 16:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-01 15:45 [PATCH RFC] 2.5.73 zlib #1 memmove Jörn Engel
2003-07-01 16:16 ` Jörn Engel [this message]
2003-07-02  8:46   ` [PATCH RFC] 2.5.73 zlib #2 codefold Joakim Tjernlund
2003-07-02 16:59     ` Jörn Engel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030701161637.GC25363@wohnheim.fh-wedel.de \
    --to=joern@wohnheim.fh-wedel.de \
    --cc=Joakim.Tjernlund@lumentis.se \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®