Re: [PATCH 2/5] Use new compress helpers in git files
From: Kristian Høgsberg <hidden>
Date: 2016-06-15 22:44:04
On Fri, 2008-01-11 at 08:37 +0100, Marco Costalba wrote:
quoted hunk ↗ jump to hunk
These are the 'easy' ones, where a signgle step compression is requested so that we can use only one call to compress_all() Signed-off-by: Marco Costalba <redacted> --- archive-zip.c | 28 +++------------------------- builtin-pack-objects.c | 21 ++++----------------- diff.c | 22 +++++----------------- index-pack.c | 20 +++----------------- 4 files changed, 15 insertions(+), 76 deletions(-)diff --git a/archive-zip.c b/archive-zip.c index 74e30f6..9071b86 100644 --- a/archive-zip.c +++ b/archive-zip.c@@ -3,6 +3,7 @@ */ #include "cache.h" #include "commit.h" +#include "compress.h" #include "blob.h" #include "tree.h" #include "quote.h"@@ -97,33 +98,10 @@ static void copy_le32(unsigned char *dest, static void *zlib_deflate(void *data, unsigned long size, unsigned long *compressed_size) {
How about just getting rid of this function alltogether, since it seems to do more or less the same as your new compress_all() function? Just change the call-sites of zlib_deflate() to call compress_all() instead.
quoted hunk ↗ jump to hunk
@@ -1037,23 +1038,10 @@ static unsigned char *deflate_it(char *data, unsigned long size, unsigned long *result_size) {
Same here. cheers, Kristian