adler32: Properly break loop into 4096-char blocks
I believe this was lost in translation in #4400. Can't say I fully understand why this is significant at all though...
Ben Alpert committed
Nov 2, 2015 at 11:28 UTC
ff6714064fe3da8f57869a1bb3fdc7bd6eb707ca
1 file changed
+2
-1
src/shared/utils/adler32.js
+2
-1
@@ -25,7 +25,8 @@ function adler32(data) {
25
var l = data.length;
26
var m = l & ~0x3;
27
while (i < m) {
28
- for (; i < Math.min(i + 4096, m); i += 4) {
28
+ var n = Math.min(i + 4096, m);
29
+ for (; i < n; i += 4) {
30
b += (
31
(a += data.charCodeAt(i)) +
32
(a += data.charCodeAt(i + 1)) +