From b6658a4a5c874be0223f44c7c1b99900185cbc60 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Mon, 25 Oct 2004 14:33:17 +0000 Subject: [PATCH] bugfix in cmatch constants_no now consider also the number of types of main --- helm/ocaml/metadata/metadataConstraints.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/helm/ocaml/metadata/metadataConstraints.ml b/helm/ocaml/metadata/metadataConstraints.ml index 2e5250f62..3a0b63d9e 100644 --- a/helm/ocaml/metadata/metadataConstraints.ml +++ b/helm/ocaml/metadata/metadataConstraints.ml @@ -466,7 +466,8 @@ let cmatch ~(dbh:Dbi.connection) t = | None -> [] | Some (main, types) -> (* the type of eq is not counted in constants_no *) - let constants_no = StringSet.cardinal constants in + let types_no = List.length types in + let constants_no = StringSet.cardinal constants + types_no in if (constants_no > critical_value) then let prefixes = prefixes just_factor t in (match prefixes with @@ -481,7 +482,7 @@ let cmatch ~(dbh:Dbi.connection) t = to apply the only constraints *) let prefixes = if constants_no = 0 then - Some main, [0, []; List.length types, types] + Some main, [0, []; types_no, types] else prefixes constants_no t in -- 2.39.2