diff options
| author | Pierre-Marie Pédrot | 2018-10-01 13:40:45 +0200 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2018-11-09 14:10:27 +0100 |
| commit | 23ef45aa14308aa0b1e1b1f6061ec9e7e7634e49 (patch) | |
| tree | 755fe122bf2b78df37d42897fdec6d66e8695de6 /engine | |
| parent | 6e5dd2ee8bc014d1f99cef3156a5114b11510398 (diff) | |
Use arrays of names instead of lists in abstract universe names.
There is little point in having a list, as there is virtually no sharing
nor expansion of bound universe names. This representation is thus more
compact.
Diffstat (limited to 'engine')
| -rw-r--r-- | engine/univNames.ml | 7 | ||||
| -rw-r--r-- | engine/univNames.mli | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/engine/univNames.ml b/engine/univNames.ml index b7ccd2372f..ad91d31f87 100644 --- a/engine/univNames.ml +++ b/engine/univNames.ml @@ -36,9 +36,9 @@ type universe_binders = Univ.Level.t Names.Id.Map.t let empty_binders = Id.Map.empty -let universe_binders_of_global ref : Name.t list = +let universe_binders_of_global ref : Name.t array = try AUContext.names (Environ.universes_of_global (Global.env ()) ref) - with Not_found -> [] + with Not_found -> [||] let name_universe lvl = (** Best-effort naming from the string representation of the level. This is @@ -51,12 +51,13 @@ let compute_instance_binders inst ubinders = try Name (LMap.find lvl revmap) with Not_found -> Name (name_universe lvl) in - Array.map_to_list map (Instance.to_array inst) + Array.map map (Instance.to_array inst) type univ_name_list = Names.lname list let universe_binders_with_opt_names ref names = let orig = universe_binders_of_global ref in + let orig = Array.to_list orig in let udecl = match names with | None -> orig | Some udecl -> diff --git a/engine/univNames.mli b/engine/univNames.mli index b00c5fda95..dc669f45d6 100644 --- a/engine/univNames.mli +++ b/engine/univNames.mli @@ -19,7 +19,7 @@ type universe_binders = Univ.Level.t Names.Id.Map.t val empty_binders : universe_binders -val compute_instance_binders : Instance.t -> universe_binders -> Names.Name.t list +val compute_instance_binders : Instance.t -> universe_binders -> Names.Name.t array type univ_name_list = Names.lname list |
