diff options
author | Gabriel Scherer <gabriel.scherer@gmail.com> | 2013-03-19 07:22:12 +0000 |
---|---|---|
committer | Gabriel Scherer <gabriel.scherer@gmail.com> | 2013-03-19 07:22:12 +0000 |
commit | 75b8c0184f38ae1c23dec9525cefafed2ea9f2d7 (patch) | |
tree | fa3a04c10767bb6e01a4760e27b6808b50d71ac5 /testsuite | |
parent | e51284dd06300f9ba9d946d8e463968db259b735 (diff) | |
download | ocaml-75b8c0184f38ae1c23dec9525cefafed2ea9f2d7.tar.gz |
PR#5933 type-specialize 'let compare = compare' on ints and strings
According to the reporter 'sliquister', type-specialized comparison
can nearly halve compilation time in some cases. This patch applies
type-specialization throughout the OCaml distribution sources, so not
all changes will have performance utility, but in this case I think
it's best to be consistent, as I see no downside to the change.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13410 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/lib-set/testmap.ml | 2 | ||||
-rw-r--r-- | testsuite/tests/lib-set/testset.ml | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/testsuite/tests/lib-set/testmap.ml b/testsuite/tests/lib-set/testmap.ml index 46b8af57d1..8eee5e5f24 100644 --- a/testsuite/tests/lib-set/testmap.ml +++ b/testsuite/tests/lib-set/testmap.ml @@ -10,7 +10,7 @@ (* *) (***********************************************************************) -module M = Map.Make(struct type t = int let compare = compare end) +module M = Map.Make(struct type t = int let compare (x:t) y = compare x y end) let img x m = try Some(M.find x m) with Not_found -> None diff --git a/testsuite/tests/lib-set/testset.ml b/testsuite/tests/lib-set/testset.ml index aaf6c72622..4f6626c111 100644 --- a/testsuite/tests/lib-set/testset.ml +++ b/testsuite/tests/lib-set/testset.ml @@ -10,7 +10,7 @@ (* *) (***********************************************************************) -module S = Set.Make(struct type t = int let compare = compare end) +module S = Set.Make(struct type t = int let compare (x:t) y = compare x y end) let testvals = [0;1;2;3;4;5;6;7;8;9] |