@@ -346,6 +346,16 @@ module LookupAndResolveMemo = MakeMemo (struct
346
346
let hash = Hashtbl. hash
347
347
end )
348
348
349
+ module HandleCanonicalModuleMemo = MakeMemo (struct
350
+ type t = Odoc_model.Paths.Path.Module .t
351
+
352
+ type result = Odoc_model.Paths.Path.Module .t
353
+
354
+ let equal x3 y3 = x3 = y3
355
+
356
+ let hash y = Hashtbl. hash y
357
+ end )
358
+
349
359
module ExpansionOfModuleMemo = MakeMemo (struct
350
360
type t = Cpath.Resolved .module_
351
361
@@ -1237,7 +1247,7 @@ and reresolve_module : Env.t -> Cpath.Resolved.module_ -> Cpath.Resolved.module_
1237
1247
| r -> `Canonical (reresolve_module env p, r))
1238
1248
| `OpaqueModule m -> `OpaqueModule (reresolve_module env m)
1239
1249
1240
- and handle_canonical_module env p2 =
1250
+ and handle_canonical_module_real env p2 =
1241
1251
let strip_alias : Cpath.Resolved.module_ -> Cpath.Resolved.module_ =
1242
1252
fun x -> match x with `Alias (_ , _ , Some p ) -> p | _ -> x
1243
1253
in
@@ -1304,7 +1314,10 @@ and handle_canonical_module env p2 =
1304
1314
if expanded then rp
1305
1315
else process_module_path env ~add_canonical: false m rp
1306
1316
in
1307
- `Resolved Lang_of. (Path. resolved_module (empty () ) cpath)
1317
+ Lang_of. (Path. module_ (empty () ) (`Resolved cpath))
1318
+
1319
+ and handle_canonical_module env p2 =
1320
+ HandleCanonicalModuleMemo. memoize handle_canonical_module_real env p2
1308
1321
1309
1322
and handle_canonical_module_type env p2 =
1310
1323
let cp2 = Component.Of_Lang. (module_type_path (empty () ) p2) in
0 commit comments