summaryrefslogtreecommitdiff
path: root/stdlib/array.ml
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez@inria.fr>2016-04-28 16:00:18 +0200
committerDamien Doligez <damien.doligez@inria.fr>2016-04-28 16:13:21 +0200
commit520fb2df50cc664a1e5c7ee465176c7933ad06a9 (patch)
tree595fe1142ec771e8df252118124e6f0ff473d756 /stdlib/array.ml
parent2c7c9b419fa9ee2a3e10123cc4ae02e173e44525 (diff)
downloadocaml-520fb2df50cc664a1e5c7ee465176c7933ad06a9.tar.gz
Merge tag 4.03.0 into trunk.
Diffstat (limited to 'stdlib/array.ml')
-rw-r--r--stdlib/array.ml15
1 files changed, 7 insertions, 8 deletions
diff --git a/stdlib/array.ml b/stdlib/array.ml
index 8e8a693d24..a4270f278a 100644
--- a/stdlib/array.ml
+++ b/stdlib/array.ml
@@ -132,7 +132,6 @@ let to_list a =
let rec list_length accu = function
| [] -> accu
| _::t -> list_length (succ accu) t
-;;
let of_list = function
[] -> [||]
@@ -189,7 +188,7 @@ let memq x a =
else loop (succ i) in
loop 0
-exception Bottom of int;;
+exception Bottom of int
let sort cmp a =
let maxson l i =
let i31 = i+i+i+1 in
@@ -236,10 +235,10 @@ let sort cmp a =
set a i (get a 0);
trickleup (bubble i 0) e;
done;
- if l > 1 then (let e = (get a 1) in set a 1 (get a 0); set a 0 e);
-;;
+ if l > 1 then (let e = (get a 1) in set a 1 (get a 0); set a 0 e)
-let cutoff = 5;;
+
+let cutoff = 5
let stable_sort cmp a =
let merge src1ofs src1len src2 src2ofs src2len dst dstofs =
let src1r = src1ofs + src1len and src2r = src2ofs + src2len in
@@ -289,7 +288,7 @@ let stable_sort cmp a =
sortto l1 t 0 l2;
sortto 0 a l2 l1;
merge l2 l1 t 0 l2 a 0;
- end;
-;;
+ end
+
-let fast_sort = stable_sort;;
+let fast_sort = stable_sort