From 1586a416567acb32662d3aebfa52b745c0d967d1 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 27 Nov 2018 19:23:15 +0000 Subject: [PATCH] Remove the 'bool compress' parameter to lz77_compress. It stopped being useful in commit 20a9bd564, where I removed the only code that called it. I've only just noticed that this part of the mechanism is still lying around. --- sshzlib.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sshzlib.c b/sshzlib.c index 39fa37eb..e20d9d04 100644 --- a/sshzlib.c +++ b/sshzlib.c @@ -94,7 +94,7 @@ static int lz77_init(struct LZ77Context *ctx); * instead call literal() for everything. */ static void lz77_compress(struct LZ77Context *ctx, - const unsigned char *data, int len, bool compress); + const unsigned char *data, int len); /* * Modifiable parameters. @@ -199,7 +199,7 @@ static void lz77_advance(struct LZ77InternalContext *st, #define CHARAT(k) ( (k)<0 ? st->data[(st->winpos+k)&(WINSIZE-1)] : data[k] ) static void lz77_compress(struct LZ77Context *ctx, - const unsigned char *data, int len, bool compress) + const unsigned char *data, int len) { struct LZ77InternalContext *st = ctx->ictx; int i, distance, off, nmatch, matchlen, advance; @@ -238,8 +238,7 @@ static void lz77_compress(struct LZ77Context *ctx, deferchr = '\0'; while (len > 0) { - /* Don't even look for a match, if we're not compressing. */ - if (compress && len >= HASHCHARS) { + if (len >= HASHCHARS) { /* * Hash the next few characters. */ @@ -668,7 +667,7 @@ void zlib_compress_block(ssh_compressor *sc, /* * Do the compression. */ - lz77_compress(&comp->ectx, block, len, true); + lz77_compress(&comp->ectx, block, len); /* * End the block (by transmitting code 256, which is