Skip to content

Commit 600f285

Browse files
JonoPrestcristianoc
authored andcommitted
Fix %bs_min and %bs_max comparison
1 parent 5238afa commit 600f285

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

compiler/ml/translcore.ml

+10-10
Original file line numberDiff line numberDiff line change
@@ -211,16 +211,6 @@ let comparisons_table =
211211
} );
212212
(* FIXME: Core compatibility *)
213213
( "%bs_min",
214-
{
215-
objcomp = Pobjmax;
216-
intcomp = Pintmax;
217-
boolcomp = Pboolmax;
218-
floatcomp = Pfloatmax;
219-
stringcomp = Pstringmax;
220-
bigintcomp = Pbigintmax;
221-
simplify_constant_constructor = false;
222-
} );
223-
( "%bs_max",
224214
{
225215
objcomp = Pobjmin;
226216
intcomp = Pintmin;
@@ -230,6 +220,16 @@ let comparisons_table =
230220
bigintcomp = Pbigintmin;
231221
simplify_constant_constructor = false;
232222
} );
223+
( "%bs_max",
224+
{
225+
objcomp = Pobjmax;
226+
intcomp = Pintmax;
227+
boolcomp = Pboolmax;
228+
floatcomp = Pfloatmax;
229+
stringcomp = Pstringmax;
230+
bigintcomp = Pbigintmax;
231+
simplify_constant_constructor = false;
232+
} );
233233
|]
234234

235235
let primitives_table =

lib/es6/Stdlib_List.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ function reduceReverse2(l1, l2, acc, f) {
896896
let a = toArray(l1);
897897
let b = toArray(l2);
898898
let r = acc;
899-
let len$1 = Primitive_int.max(a.length, b.length);
899+
let len$1 = Primitive_int.min(a.length, b.length);
900900
for (let i = len$1 - 1 | 0; i >= 0; --i) {
901901
r = f(r, a[i], b[i]);
902902
}

lib/js/Stdlib_List.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ function reduceReverse2(l1, l2, acc, f) {
896896
let a = toArray(l1);
897897
let b = toArray(l2);
898898
let r = acc;
899-
let len$1 = Primitive_int.max(a.length, b.length);
899+
let len$1 = Primitive_int.min(a.length, b.length);
900900
for (let i = len$1 - 1 | 0; i >= 0; --i) {
901901
r = f(r, a[i], b[i]);
902902
}

0 commit comments

Comments
 (0)