Commit 307a3d6762a2797ee28b43fceb1c941680ac97ec

Jared Wong 2013-12-08T01:50:10

Fixed left shift size of int. Simply switched the ordering of the checks in the for loop where this left shift was being made.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/delta.c b/src/delta.c
index b3435ba..8375a2c 100644
--- a/src/delta.c
+++ b/src/delta.c
@@ -144,7 +144,7 @@ git_delta_create_index(const void *buf, unsigned long bufsize)
 		entries = 0xfffffffeU / RABIN_WINDOW;
 	}
 	hsize = entries / 4;
-	for (i = 4; (1u << i) < hsize && i < 31; i++);
+	for (i = 4; i < 31 && (1u << i) < hsize; i++);
 	hsize = 1 << i;
 	hmask = hsize - 1;