From 75c42d8cc3b42e4b82946848b8ba902b4bbcc38d Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 25 Jun 2005 19:30:20 -0700 Subject: Add a "max_size" parameter to diff_delta() Anything that generates a delta to see if two objects are close usually isn't interested in the delta ends up being bigger than some specified size, and this allows us to stop delta generation early when that happens. --- test-delta.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test-delta.c') diff --git a/test-delta.c b/test-delta.c index 8751e27c6..da51efc24 100644 --- a/test-delta.c +++ b/test-delta.c @@ -60,10 +60,12 @@ int main(int argc, char *argv[]) if (argv[1][1] == 'd') out_buf = diff_delta(from_buf, from_size, - data_buf, data_size, &out_size); + data_buf, data_size, + &out_size, ~0UL); else out_buf = patch_delta(from_buf, from_size, - data_buf, data_size, &out_size); + data_buf, data_size, + &out_size); if (!out_buf) { fprintf(stderr, "delta operation failed (returned NULL)\n"); return 1; -- cgit v1.2.1