diff options
author | Guillaume Melquiond <guillaume.melquiond@inria.fr> | 2015-12-22 22:35:09 +0100 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@inria.fr> | 2015-12-22 22:35:09 +0100 |
commit | 602badcad9deec9224b78cd1e1033af30358ef2e (patch) | |
tree | e528188a52c4120fa94a5e0ff2c035874dee75cf /printing/ppconstr.ml | |
parent | d55676344c8dc0d9a87b2ef12ec2348281db4bf5 (diff) |
Do not compose "str" and "to_string" whenever possible.
For instance, calling only Id.print is faster than calling both str and
Id.to_string, since the latter performs a copy. It also makes the code a
bit simpler to read.
Diffstat (limited to 'printing/ppconstr.ml')
-rw-r--r-- | printing/ppconstr.ml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/printing/ppconstr.ml b/printing/ppconstr.ml index 56429410c..d15c3ee2f 100644 --- a/printing/ppconstr.ml +++ b/printing/ppconstr.ml @@ -153,11 +153,11 @@ end) = struct let pr_qualid sp = let (sl, id) = repr_qualid sp in - let id = tag_ref (str (Id.to_string id)) in + let id = tag_ref (pr_id id) in let sl = match List.rev (DirPath.repr sl) with | [] -> mt () | sl -> - let pr dir = tag_path (str (Id.to_string dir)) ++ str "." in + let pr dir = tag_path (pr_id dir) ++ str "." in prlist pr sl in sl ++ id @@ -182,7 +182,7 @@ end) = struct let pr_reference = function | Qualid (_, qid) -> pr_qualid qid - | Ident (_, id) -> tag_var (str (Id.to_string id)) + | Ident (_, id) -> tag_var (pr_id id) let pr_cref ref us = pr_reference ref ++ pr_universe_instance us |