Skip to content

Commit 3404ded

Browse files
authored
Merge pull request #2790 from BuckleScript/fix_expoentional_behavior
fix an embarassing bug which caused exponential behavior
2 parents 0ea9828 + 68d315e commit 3404ded

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

jscomp/others/belt_SetInt.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ let rec add (t : t) (x : value) : t =
4949
else
5050
let rr = add r x in
5151
if rr == r then t
52-
else N.bal l v (add r x)
52+
else N.bal l v rr
5353

5454
let mergeMany h arr =
5555
let len = A.length arr in

jscomp/others/belt_SetString.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ let rec add (t : t) (x : value) : t =
4949
else
5050
let rr = add r x in
5151
if rr == r then t
52-
else N.bal l v (add r x)
52+
else N.bal l v rr
5353

5454
let mergeMany h arr =
5555
let len = A.length arr in

jscomp/others/set.cppo.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ let rec add (t : t) (x : value) : t =
5353
else
5454
let rr = add r x in
5555
if rr == r then t
56-
else N.bal l v (add r x)
56+
else N.bal l v rr
5757

5858
let mergeMany h arr =
5959
let len = A.length arr in

jscomp/test/.depend

+5-5
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ bs_sort_test.cmj : mt.cmj ../others/belt.cmj array_data_util.cmj
125125
bs_splice_partial.cmj : ../runtime/js.cmj
126126
bs_stack_test.cmj : ../runtime/js.cmj ../others/belt.cmj
127127
bs_string_test.cmj : mt.cmj ../runtime/js.cmj
128-
bs_unwrap_test.cmj : ../runtime/js.cmj
128+
bs_unwrap_test.cmj :
129129
buffer_test.cmj : ../stdlib/string.cmj mt.cmj ../stdlib/bytes.cmj \
130130
../stdlib/buffer.cmj
131131
bytes_split_gpr_743_test.cmj : mt.cmj ../runtime/js.cmj ../stdlib/bytes.cmj
@@ -261,7 +261,7 @@ global_exception_regression_test.cmj : mt.cmj
261261
global_mangles.cmj :
262262
global_module_alias_test.cmj : mt.cmj ../stdlib/list.cmj
263263
google_closure_test.cmj : test_google_closure.cmj mt.cmj
264-
gpr496_test.cmj : ../stdlib/pervasives.cmj mt.cmj ../runtime/js.cmj
264+
gpr496_test.cmj : ../stdlib/pervasives.cmj mt.cmj
265265
gpr_1063_test.cmj :
266266
gpr_1072.cmj : ../runtime/js.cmj
267267
gpr_1072_reg.cmj :
@@ -367,7 +367,7 @@ int_overflow_test.cmj : ../stdlib/string.cmj mt.cmj ../runtime/js.cmj \
367367
../stdlib/int32.cmj ../stdlib/char.cmj
368368
io_test.cmj : ../runtime/js.cmj
369369
js_array_test.cmj : mt.cmj ../runtime/js.cmj ../stdlib/array.cmj
370-
js_bool_test.cmj : mt.cmj ../runtime/js.cmj
370+
js_bool_test.cmj : mt.cmj
371371
js_cast_test.cmj : mt.cmj ../others/js_cast.cmj
372372
js_date_test.cmj : mt.cmj ../runtime/js_float.cmj ../runtime/js.cmj
373373
js_dict_test.cmj : ../stdlib/obj.cmj mt.cmj ../others/js_dict.cmj
@@ -376,7 +376,7 @@ js_float_test.cmj : mt.cmj ../runtime/js_float.cmj
376376
js_global_test.cmj : mt.cmj ../others/js_global.cmj
377377
js_int_test.cmj : mt.cmj ../runtime/js_int.cmj
378378
js_json_test.cmj : mt.cmj ../others/js_json.cmj ../others/js_dict.cmj \
379-
../others/js_boolean.cmj ../runtime/js.cmj ../stdlib/array.cmj
379+
../runtime/js.cmj ../stdlib/array.cmj
380380
js_list_test.cmj : mt.cmj ../runtime/js.cmj
381381
js_math_test.cmj : mt.cmj ../runtime/js.cmj
382382
js_null_test.cmj : mt.cmj ../runtime/js_null.cmj
@@ -586,7 +586,7 @@ test_ari.cmj : ../stdlib/list.cmj
586586
test_array.cmj : ../stdlib/array.cmj
587587
test_array_append.cmj : ../stdlib/array.cmj
588588
test_array_primitive.cmj : ../stdlib/array.cmj
589-
test_bool_equal.cmj : ../runtime/js.cmj ../others/belt.cmj
589+
test_bool_equal.cmj : ../others/belt.cmj
590590
test_bs_this.cmj : ../runtime/js.cmj
591591
test_bug.cmj : ../stdlib/bytes.cmj
592592
test_bytes.cmj : ../stdlib/bytes.cmj

lib/js/belt_SetInt.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function add(t, x) {
2323
if (rr === r) {
2424
return t;
2525
} else {
26-
return Belt_internalAVLset.bal(l, v, add(r, x));
26+
return Belt_internalAVLset.bal(l, v, rr);
2727
}
2828
}
2929
}

lib/js/belt_SetString.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function add(t, x) {
2323
if (rr === r) {
2424
return t;
2525
} else {
26-
return Belt_internalAVLset.bal(l, v, add(r, x));
26+
return Belt_internalAVLset.bal(l, v, rr);
2727
}
2828
}
2929
}

0 commit comments

Comments
 (0)