File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -362,15 +362,15 @@ let reduceReverse2U a b x f =
362
362
let reduceReverse2 a b x f =
363
363
reduceReverse2U a b x (fun [@bs ] a b c -> f a b c)
364
364
365
- let rec reduceWithIndexAuxU a acc f i =
366
- match a with
367
- | [||] -> acc
368
- | x :: xs -> reduceWithIndexAuxU xs ((f acc x i) [@ bs]) f (i + 1 )
369
-
370
- let reduceWithIndexU a acc f = reduceWithIndexAuxU a acc f 0
365
+ let reduceWithIndexU a x f =
366
+ let r = ref x in
367
+ for i = 0 to length a - 1 do
368
+ r := f ! r (getUnsafe a i) i [@ bs]
369
+ done ;
370
+ ! r
371
371
372
- let reduceWithIndex a acc f =
373
- reduceWithIndexU a acc (fun [@bs ] acc x i -> f acc x i )
372
+ let reduceWithIndex a x f =
373
+ reduceWithIndexU a x (fun[@ bs] a b c -> f a b c )
374
374
375
375
let rec everyAux arr i b len =
376
376
if i = len then true
You can’t perform that action at this time.
0 commit comments