From 55944d161c80af45ad60e8fe46a02e09501ccee2 Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Tue, 29 Dec 2009 13:07:22 -0500 Subject: [PATCH] Make split condition depend on ~0, not 0. Otherwise we could end up splitting on one-byte blocks, which is pretty dumb. --- hashsplit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hashsplit.c b/hashsplit.c index 3b764f2..60ba302 100644 --- a/hashsplit.c +++ b/hashsplit.c @@ -70,7 +70,7 @@ int main() i = (i + 1) % WINDOWSIZE; count++; - if ((sum & (BLOBSIZE-1)) == 0) + if ((sum & (BLOBSIZE-1)) == ((~0) & (BLOBSIZE-1))) { fprintf(stderr, "SPLIT @ %-8d size=%-8d (%d/%d)\n", count, count - last_count, BLOBSIZE, WINDOWSIZE); -- 2.39.2